iOS developing note part4 Some Tips

What a wonderful day !! Isn’t it?

Well, I got something good happened.

  • After 30 days hard working, my main project has been submitted today, by myself. And the manager in Shanghai had completely accepted that I am a GREAT developer, and they can absolutely count on me.

  • My private project which is cooperated with Billy, named EbolaQuiz is gonna be submitted today too! It is a free, charitable app, it contains lots of knowledges and facts about Ebola, The idea came from Billy, he tried to find out an ‘lightheaded’ way to make people to be brave to face the virus. I think he did it.

  • Got another 100% on EF writing challenge !! Can’t believe it !!

  • I passed the examination yesterday, and came into level 9 in EF.

  • Completed 3 complicated  classes on Saturday, with high-quality.

  • Did a drawing for my mom’s birthday. Here it is. Both of ours zodiac is Dog.

  • My iPhone 6 plus will be arrived tomorrow.
    All right, let me calm down for a while……1……2……3.

Start to record development tips:

Unchangeable IBOutLet component position.

It stuck me for a long while, if you dragged something to xib file, or to storyboard, then you want to change its position programmatically, sometime you may find it is unable to change. Remember to unselect these two fucking checkboxes will solve it.

Once again, I really can’t stand IB !!

A Right way to make sizeToFit work perfectly.

Sometimes you need to resize the frame of a UILabel dynamically, keep the width in a specific value, after resize you need a new size to do layout. Here’s the way:

theLabel.frame = CGRectMake(theLabel.frame.origin.x, theLabel.frame.origin.y, widthToRemain, 0);
theLabel.lineBreakMode = NSLineBreakByWordWrapping;
theLabel.numberOfLines = 0;
[theLabel sizeToFit];
Insert special character in to xml(html) document

It’s a basic question, the key word is  HTML Entity (case sensitive), look at here. And some common characters:

"      "
&      &
>      >
<      &lt;
space  &nbsp;

 

“Your account already has a valid iOS distribution certificate” Error when export a adhoc ipa file.

It’s probably not going to happen if you use same Mac computer, but it happens on me. It seems like a bug of validation. What I can do is, regenerate distribution certificate with your current Mac. Remove all the provisioning file about the target AppID. Try again.

Share message via FaceBook, Twitter.

Don’t want to tell the deep integration way, you can hit here, and here. What I am trying to discuss here is the URL Schemes way. It is simple but useful.

  1. Find the scheme here.
  2. Implement it like this:
    NSString *stringURL = @"twitter://post?message=MessageYouWantToPost";
    NSURL *url = [NSURL URLWithString:stringURL];
    [[UIApplication sharedApplication] openURL:url];
“Error: description not available” when submit ipa to itunes connect.
  • If you’re working on a old version project, try to recreate a new one, then move all the assets into it.
  • I know you hate the first one, please check your “Project Target” and see the “Code Signing” part, see what if it points to a ad hoc provisioning.
  • If it still doesn’t work, try to open you project with XCode 5.1.1 or submit with Application Loader 2.9.1
    Yosemite is Great, both for the landscape and the OS. So I draw this for myself.