国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

iOS開發-Object-C獲取手機設備信息(UIDevice)

2019-11-14 19:44:48
字體:
來源:轉載
供稿:網友

一、獲取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(@"%@", [NSLocale PReferredLanguages]);// 獲取系統所有本地化標識符數組列表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)

 


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 海宁市| 阿荣旗| 冕宁县| 定结县| 镇原县| 濉溪县| 苍南县| 同心县| 县级市| 宁远县| 肇州县| 武强县| 江达县| 天台县| 平武县| 辽源市| 陆河县| 长阳| 龙门县| 榆中县| 西宁市| 巨鹿县| 西丰县| 辽宁省| 河北区| 永济市| 沿河| 凯里市| 阿拉善左旗| 兴仁县| 射阳县| 万山特区| 邛崃市| 徐州市| 大英县| 平凉市| 镇赉县| 富川| 正蓝旗| 池州市| 河间市|