iOS關于若何獲取設備相關信息,APP版本號,電池電量,當前系統名稱等。
獲取iPhone名稱:
[UIDevice currentDevice].name;
獲取app版本號:
[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
獲取電池電量:
[UIDevice currentDevice].batteryLevel;
獲取當前系統名稱:
[UIDevice currentDevice].systemName;
獲取當前系統版本號:
[UIDevice currentDevice].systemVersion;
獲取UUID:
[[UIDevice currentDevice] identifierForVendor].UUIDString;
獲取總內存巨細:
[NSProcessInfo processInfo].physicalMemory;
獲取當前說話:
NSArray *languageArray = [NSLocale preferredLanguages];
[languageArray objectAtIndex:0]
0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!