Summary of differences between iOS 6 and iPhone 5

Source: Internet
Author: User

So far, I have made some work to adapt the old project to iOS 6 and iPhone 5, and summarized some things:

 

1. For iPhone 5 and iOS 6, xcode4.5 is required at the lowest level. xcode4.5 does not support armv6, that is, systems below iOS4.3.3.

Unsupported hardware devices include: iPod 2nd gen, iPhone 3G or older iPhone

For example, the error message during packaging is:

Warning: iOS deployment targets lower than 4.3 are not supported (current

IPHONEOS_DEPLOYMENT_TARGET = "4.0", ARCHS = "armv7 ").


(Null): iPhone/iPod Touch: application executable is missing a required

Architecture. At least one

Of the following architecture (s) must be

Present: armv6 (-19033)

 


2. 4 inch screen adaptation

To adapt to the 4 inch screen, the system creates a default-568h@2x.png image, and determines whether the system has the resource.

4 inch screens are supported. When other resources do not allow xxx-568h.jpg to be used to adapt to the screen, you need to use code to detect the screen separately

.

Code used to determine the iPhone 5:


# Define iPhone5 ([UIScreen instancesRespondToSelector: @ selector (currentMode)]? CGSizeEqualToSize (CGSizeMake (640,1136), [[UIScreen mainScreen] currentMode]. size): NO)

# Define iPhone5_0 ([UIScreen instancesRespondToSelector: @ selector (currentMode)]? CGSizeEqualToSize (CGSizeMake (320,568), [[UIScreen mainScreen] currentMode]. size): NO)

Why do I need to write two items? This is not useless. If the code is written to the interface, the View height in iPhone 5 is 568, that is, when judging

The second macro is used. It is best to write these two Macros in the project's XXX-Prefix.pch file.

 

3. Control the rotation of the view due to the ios6 screen conversion problem

For details, refer to an article in my blog titled "adaptation of old projects to iOS 6 and iPhone 5 to iOS 6 and screen conversion ";

 

4. UINavigationViewController changes

During the development process, the initWithRootViewController of this class will eventually call the init method in the previous version.

Therefore, when inheriting UINavigationViewController, you can directly override the init method to initialize the required attributes of the object.

However, the init method is not called on iOS6, so developers need to pay attention to it.

 

5. CFRelease changes


In earlier versions, if CFRelease is allowed to pass in nil, it does not affect our program, but in iOS6,

Such a program is

The Crash of your program is directly removed, so you need to determine whether it is nil in the code.
6. UIPickerView changes

In earlier versions, calling [_ pickerView selectRow:-1 inComponent: 0 animated: YES]; is allowed. However

IOS6 may cause a crash.

 

7. Changes in UIActivityIndicatorView

In earlier versions, if the startAnimating method is called, you only need to add UIActivityIndicatorView to the subview.

The loaded animation is displayed, but the animation is stopped as long as iOS6 is removed from the display queue, especially when this control is added to UITableViewCell,

Scroll a few times

The Cell's UIActivityIndicatorView disappears. To solve this problem, you can
IsAnimating attribute to determine whether to execute the animation. If not, call the startAnimating method again.

For (UIView * _ curView in cell. subviews ){

If ([_ curView isKindOfClass: [UIActivityIndicatorView class]) {
[(UIActivityIndicatorView *) _ curView startAnimating];
Break;
}
}

 

8. Differences in obtaining the address book list www.2cto.com

For details, refer to the article "getting the address book user list under iOS6.0" written in my blog ";

 

9. In ios6, The viewDidUnLoad function is revoked. What should I do if I receive a memory warning?

For more information, see the article "official ViewController programming guide" in my blog,

Do this after iOS6: Really ?";

 

At present, the adaptation work has not been completed yet. Only these changes are known, and new differences will be further supplemented.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.