Summary of differences between iOS 6 and earlier versions

Source: Internet
Author: User

1. Adapt to 4 inch screen adaptation. To adapt to the 4 inch screen, the system creates a default-568h@2x.png image and identifies whether the system supports the 4 inch screen based on the resource. As for other resources, xxx-568h.jpg is not allowed to be used to adapt to the screen. You need to use the code to detect the screen for adaptation. 2. UINavigationViewController changes found during the development process today, 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. Www.2cto. com3, CFRelease changes in earlier versions if CFRelease is allowed to pass in nil, it also conforms to our nil object will not affect our program, but in iOS6, in this way, the program directly drops your program Crash, so you need to determine whether nil is safe in the code. 4. UIPickerView changes are allowed by calling [_ pickerView selectRow:-1 inComponent: 0 animated: YES] in previous versions. However, iOS6 may cause a crash. 5. In previous versions, if the startAnimating method is called, adding the UIActivityIndicatorView to the subview will display the loaded animation, however, as long as the display queue is removed from iOS6, the animation will be stopped, especially when this control is added to UITableViewCell, as long as the UIActivityIndicatorView of the Cell is rolled down, to solve this problem, you can judge whether to execute the animation based on the isAnimating attribute when adding the display queue. If not, call the startAnimating method again. 6. To obtain the address book list after obtaining the difference from iOS6.0, you need to ask the user for the address book list. After the user's consent, you can obtain the address book user list. In addition, the initialization of ABAddressBookRef is also changed from the ABAddressBookCreate function to the abaddressbookcreatewitexceptions function. The following code is compatible with the previous version to obtain the address book user list. ABAddressBookRef addressBook = nil; if ([UIDevice currentDevice]. systemVersion floatValue]> = 6.0) {addressBook = abaddressbookcreatewitexceptions (NULL, NULL); // execute dispatch_semaphore_t sema = dispatch_semaphore_create (0); then (addressBook, ^ (bool granted, CFErrorRef error) {encrypt (sema) ;}); encrypt (sema, DISPATCH_TIME_FOREVER); dispatch_release (sema);} else {addressBook = ABAddressBookCreate ();} NSArray * personArray = (NSArray *) ABAddressBookCopyArrayOfAllPeople (addressBook );

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.