概述-(void)getIOSVersion { // #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 50000 //此方法和编译器相关 // quanju.iOSVersion=1; // #endif float version = [[[UIDevice currentDevice] systemVersion] floatValue]; if (ve
-(voID)getIOsversion
{
// #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 50000 //此方法和编译器相关
// quanju.iOsversion=1;
// #endif
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 5.0)
{
quanju.iOsversion=1;//定义全局变量标记ios版本
}
}
-(voID)getIOSModel
{
CGSize sizetoRequest;
if([[[UIDevicecurrentDevice] model] rangeOfString:@"iPad"].location== 0)
sizetoRequest = CGSizeMake(748, 110);
else
sizetoRequest = 320,216)">48);
}
//下面是ios内其他相关信息的判断方法
获取进程信息和设备信息(包括设备类型,序列号,ios版本等) [[nsprocessInfo processInfo] globallyUniqueString], [[nsprocessInfo processInfo] hostname], [[nsprocessInfo processInfo] operatingSystemname], [[nsprocessInfo processInfo] operatingSystemVersionString], [[nsprocessInfo processInfo] physicalMemory], [[nsprocessInfo processInfo] processname]); —————————————————————————————— [UIDevice currentDevice].uniqueIDentifIEr, [UIDevice currentDevice].name, [UIDevice currentDevice].systemname, [UIDevice currentDevice].systemVersion, [UIDevice currentDevice].model, [UIDevice currentDevice].localizedModel, [UIDevice currentDevice].batterylevel ___________________________________________________ NSLog([[UIDevice currentDevice] name]); // name of the phone as named by user NSLog([[UIDevice currentDevice] uniqueIDentifIEr]); // A GUID like string NSLog([[UIDevice currentDevice] systemname]); // "iPhone OS" NSLog([[UIDevice currentDevice] systemVersion]); // "2.2.1" NSLog([[UIDevice currentDevice] model]); // "iPhone" on both devices NSLog([[UIDevice currentDevice] localizedModel]); // "iPhone" on both devices
转自:http://blog.csdn.net/jinglijun/article/details/7292674 |
总结
以上是内存溢出为你收集整理的怎么判断ios 版本全部内容,希望文章能够帮你解决怎么判断ios 版本所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)