一、獲取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]);
新聞熱點
疑難解答