转载: http://blog.sina.com.cn/s/blog_7b9d64af0101bu9j.html
// 判断设备的iOS 版本号
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
NSLog(@"%f",version);
二、我们还可以获得更多相应的设备信息
NSLog(@"%@",[[UIDevice currentDevice] name]); // Name of the phone as named by user
NSLog(@"%@",[[UIDevice currentDevice] uniqueIdentifier]); // A GUID like string
NSLog(@"%@",[[UIDevice currentDevice] identifierForVendor]); // A GUID like string(iOS 6.0)
NSLog(@"%@",[[UIDevice currentDevice] systemName]); // "iPhone OS"
NSLog(@"%@",[[UIDevice currentDevice] systemVersion]); // "5.1.1"
NSLog(@"%@",[[UIDevice currentDevice] model]); // "iPhone" on both devices
NSLog(@"%@",[[UIDevice currentDevice] localizedModel]); // "iPhone" on both devices
三、获得App的版本号
// 获得软件的版本号,
NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
float softVerson =[[infoDict objectForKey:@"CFBundleShortVersionString"] floatValue];
读取 Info.plist文件的信息。
NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];