iOS开发-Object-C获取手机设备信息(UIDevice)

王朝学院·作者佚名  2016-08-27
窄屏简体版  字體: 小  |  中  |  大  |  超大  

一、获取UiDevice设备信息

//获取设备名称NSString *name =[[UIDevice currentDevice] name];//获取设备系统名称NSString *systemName =[[UIDevice currentDevice] systemName];//获取系统版本NSString *systemVersion =[[UIDevice currentDevice] systemVersion];//获取设备模型NSString *model =[[UIDevice currentDevice] model];//获取设备本地模型NSString *localizedModel = [[UIDevice currentDevice] localizedModel];

二、获取Bundle的相关信息

NSDictionary *infoDict =[[NSBundle mainBundle] infoDictionary];//app名称NSString *appName = infoDict[@"CFBundleName"];//app版本NSString *appVersion = infoDict[@"CFBundleShortVersionString"];//app build版本NSString *appBuild = infoDict[@"CFBundleVersion"];

NSLocal获取本地化数据:

//获取用户的语言偏好设置列表NSLog(@"%@", [NSLocalePReferredLanguages]);//获取系统所有本地化标识符数组列表NSLog(@"%@", [NSLocale availableLocaleIdentifiers]);//获取所有已知合法的国家代码数组列表NSLog(@"%@", [NSLocale ISOCountryCodes]);//获取所有已知合法的ISO货币代码数组列表NSLog(@"%@", [NSLocale ISOCurrencyCodes]);//获取所有已知合法的ISO语言代码数组列表NSLog(@"%@", [NSLocale ISOLanguageCodes]);//获取当前系统设置语言的标识符//方法一NSLog(@"%@", [[NSLocale currentLocale] localeIdentifier]);//方法二NSLog(@"%@", [[NSLocale currentLocale] objectForKey:NSLocaleIdentifier]);

IOS开发-Swift获取手机设备信息(UIDevice)

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航