ios获取app一样版本信息 & 获取设备的基本信息

2016-07-06  本文已影响114人  小小Q吖
NSDIctionary *infoDictionary = [[NSBundle mainBundel]infoDictionary];
NSString *name = [infoDictionary objectForKey:@"CFBundleName"];
NSString *version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
NSString *build = [infoDictionary objectForKey:@"CFBundleVersion"];
NSLog(@"%@,%@,%@,%@",infoDictionay,name,version,build);
@property(nonatomic ,readonly,strong) NSString *name //设备的名称,如xxx的iPhone6s
@property(nonatomic ,readonly ,strong)NSString *model;//设备的类型,例如 iPhone iPad touch
@property(nanatomic,readonly,strong)NSString *localizedModel; //localized version of model
@property(nonatomic,readonly,strong)NSString *systemVersion; //操作系统的版本号 如 8,3 9.2等
//获取设备的基本信息
通过UIDevice类的对象,可以获取ios设备如下的信息]
UIDevice *device = [UIDevice currentDevice];
NSLog(@"%@",device.name);
NSLog(@"%@",device.model);
NSLog(@"%@",device.localizedModel);
NSLog(@"%@",device.systemVersion);
//获取设备的UUID
NSLog(@"%@",device.identifierForVendor.UUIDString);

转自 http://www.jianshu.com/p/9a673c22af31

上一篇下一篇

猜你喜欢

热点阅读