Summary of the differences between the development iOS6 and iphone5 versions and the previous versions

http://www.cdtarena.com/gpx/201211/6398.html

 

 

 

 

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


For example, the error message when I packaged 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

....................................................................


2. Adapt to 4-inch screen adaptation

To adapt the old application to a 4-inch screen, you need to create a [email protected] image, and the system will identify whether it has this resource or not.

Support 4 inch screen. As for other resources, it is not allowed to use the format of xxx-568h.jpg to adapt to the screen. You need to use code to detect the screen to distinguish

to adapt.

The code generally used to judge the iphone5:


#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 you want to write 2? This is not useless. If the code is written in the interface, the height of the View under iPhone5 is 568, which is the time to judge.

The macro used is the second one. It is best to write these two macros in the XXX-Prefix.pch file of the project.


3. ios6 screen rotation problem, control the rotation of the view

This can refer to an article written in my blog "Adapting old projects to ios6 and iphone5 to adapt to ios6 screen rotation";


4. Changes in UINavigationViewController

It was found during the development process that the initWithRootViewController of this class would eventually call the init method in the previous version.

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

But on iOS6, the init method will not be called, so developers need to pay attention.


5. Changes in CFRelease

In the previous version, if CFRelease passed nil, it was allowed, which also accorded with the fact that we passed nil object will not affect our program, but in iOS6,

Such a program of writing

Crash your program directly, so it is still safe to judge whether it is nil in the code.


6. Changes of UIPickerView


In previous versions calling [_pickerView selectRow:-1 inComponent:0 animated:YES]; was allowed. but in

Will cause a crash in iOS6.

 

7. Changes in UIActivityIndicatorView

In the previous version, if the startAnimating method was called, just add UIActivityIndicatorView to the subview

The loading animation will be displayed, but in iOS6, the animation will stop as long as it is removed from the display queue, especially when this control is added to UITableViewCell,

Just scroll a few times

Cell's
UIActivityIndicatorView disappears.
To solve this problem, you can

isAnimating property to determine whether to perform animation,
if not, call the startAnimating method again.

for (UIView *_curView in cell.subviews) {


      if ([_curView isKindOfClass:[UIActivityIndicatorView class]]) {
        [(UIActivityIndicatorView *)_curView startAnimating];
        break;
      }
    }

 

8. Get the difference in the address book list


This can refer to an article written in my blog "Getting the list of address book users under iOS6.0";

 

9. Since the viewDidUnLoad function was cancelled in ios6, what should I do if I receive a memory warning?

Do this after iOS6: Really?";

 

10. In ios6, the keyboard of Chinese input method has changed a bit

In the past, as soon as you switched to the Chinese input method, the option bar would appear, so everyone used to monitor the keyboard.

UIKeyboardWillShowNotification and UIKeyboardWillHideNotification, but now the alternative column is displayed after typing

, so you can't use this notification, you should use UIKeyboardDidChangeFrameNotification.

At present, the adaptation work has not been completed, only these changes are known, and new differences will be found in the future, and then they will be supplemented one after another.

Literature: http://www.verydemo.com/demo_c134_i3152.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326606377&siteId=291194637