1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > iOS 设备获取设备相关信息

iOS 设备获取设备相关信息

时间:2019-07-04 11:04:31

相关推荐

iOS 设备获取设备相关信息

+ (void)addDevice {//设备相关信息的获取NSString *strName = [[UIDevice currentDevice] name];NSLog(@"设备名称:%@", strName);//e.g. "My iPhone"NSString *strSysName = [[UIDevice currentDevice] systemName];NSLog(@"系统名称:%@", strSysName);// e.g. @"iOS"NSString *strSysVersion = [[UIDevice currentDevice] systemVersion];NSLog(@"系统版本号:%@", strSysVersion);// e.g. @"4.0"NSString *strModel = [[UIDevice currentDevice] model];NSLog(@"设备模式:%@", strModel);// e.g. @"iPhone", @"iPod touch"NSString *strLocModel = [[UIDevice currentDevice] localizedModel];NSLog(@"本地设备模式:%@", strLocModel);// localized version of model//app应用相关信息的获取// NSDictionary *dicInfo = [[NSBundle mainBundle] infoDictionary];// CFShow(dicInfo);NSString *strAppName = [dicInfo objectForKey:@"CFBundleDisplayName"];NSLog(@"App应用名称:%@", strAppName);NSString *strAppVersion = [dicInfo objectForKey:@"CFBundleShortVersionString"];NSLog(@"App应用版本:%@", strAppVersion);NSString *strAppBuild = [dicInfo objectForKey:@"CFBundleVersion"];NSLog(@"App应用Build版本:%@", strAppBuild);}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。