由于代码中需要实现某个5.0后才能支持的方法,所以添加一个判断。
获取系统版本号的方法:
[[UIDevice currentDevice] systemVersion];
判断是否大于版本5.0:
float systemVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
if (systemVersion >= 5.0)
{
//某个仅支持5.0以上版本的方法
}
其他ios系统信息:
[[UIDevice currentDevice] name]); // Name of the phone as named by user
[[UIDevice currentDevice] uniqueIdentifier]); // A GUID like string
[[UIDevice currentDevice] systemName]); // "iPhone OS"
[[UIDevice currentDevice] systemVersion]); // "2.2.1"
[[UIDevice currentDevice] model]); // "iPhone" on both devices
[[UIDevice currentDevice] localizedModel]); // "iPhone" on both devices