Nslog ([[uidevice currentdevice] Name]); // obtain the device name
Nslog ([[uidevice currentdevice] uniqueidentifier]); // obtain the guid
Nslog ([[uidevice currentdevice] systemname]); // obtain the system name
Nslog ([[uidevice currentdevice] systemversion]); // version
Eg.
Float version = [[[uidevice currentdevice] systemversion] floatvalue];
If (version> = 5.0 ){
// IOS Processing
}
Recently, I found it in my project. The coordinates of ios5 and earlier versions (ios4.0.2) are different. The difference is exactly 20 PX. Therefore, use the special processing of the pull surface.
2. As IOS versions become more and more popular, the compatibility problem of program crashes gradually becomes apparent. For example, it may be because some APIs are only used for ios4, and other APIs must be used for processing in ios5. At this time, your code may contain these two versions of the program. However, the xcode version of this program may not have any programming method. At this time, you can avoid this by using the following methods:
# If _ iphone_ OS _version_max_allowed >=50000
// IOS 5
// Ex. if the version to be checked is 4.1, you can use 40100
# Endif
If you want to check whether a class can be used, you can use this method:
Class ios5class = (nsclassfromstring (@ "ciimage "));
If (nil! = Ios5class ){
}
* For Versions later than 4.2, you can use weak linking for query. For example:
If ([ciimage class]) {
}
If you want to check whether a certain selector exists in a class, you can use respondstoselector in the nsobject Protocol example to check the class. For example:
If ([OBJ respondstoselector @ selector (goodbye:]) {
}
From: http://blog.csdn.net/nogodoss/article/details/7187022