標籤:
一、擷取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]);
?Object-C擷取手機裝置資訊