如何在目标c中获取操作系统名称

Fer*_*yan 2 objective-c ios

我想检测objective-c中的当前设备操作系统名称(如操作系统:iOS)

你能帮助我解决我的问题吗?

提前致谢

Ban*_*ngs 15

 NSString *strName = [[UIDevice currentDevice] name];  
 NSLog(@"%@", strName);//e.g. "My iPhone"   

 NSString *strSysName = [[UIDevice currentDevice] systemName];  
 NSLog(@"%@", strSysName);// e.g. @"iOS"  

 NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];  
 NSLog(@"%@", strSysVersion);// e.g. @"4.0"  

 NSString *strModel = [[UIDevice currentDevice] model];  
 NSLog(@"%@", strModel);// e.g. @"iPhone", @"iPod touch"  

 NSString *strLocModel = [[UIDevice currentDevice] localizedModel];  
 NSLog(@"%@", strLocModel);// localized version of model  
Run Code Online (Sandbox Code Playgroud)