UIDevice类,方便开发者获取设备相关信息
获取UIDevice类的对象(类方法)
+ (UIDevice *)currentDevice;
UIDevice中的属性,
注释中对各属性都有解释
@property(nonatomic,readonly,retain) NSString *name; // e.g. "My iPhone"
@property(nonatomic,readonly,retain) NSString *model; // e.g. @"iPhone", @"iPod touch"
@property(nonatomic,readonly,retain) NSString *localizedModel; // localized version of model
@property(nonatomic,readonly,retain) NSString *systemName; // e.g. @"iOS"
@property(nonatomic,readonly,retain) NSString *systemVersion; // e.g. @"4.0"
@property(nonatomic,readonly) UIDeviceOrientation orientation; // return current device orientation. this will
@property(nonatomic,readonly,retain) NSUUID *identifierForVendor NS_AVAILABLE_IOS(6_0);
在UIDevice类中有一个属性,支持iOS6以后的系统版本,叫identifierForVendor(运营商ID)。
注意:在同一个设备上,同一个运营商的不同应用的运营商ID都是相同的,但是如果同一个运营商的应用全部删除以后,再添加该运营商的任何一个应用,这是这个运营商ID与之前的会不同,变成了另外一个新的ID.但为了唯一标识某一个应用的某一个用户时,这个ID是不好用的,可以使用OpenUDID这个第三方的类来进行代替,但是OpenUDID只能标记一个应用的一个设备,在同一个设备同一个运营商的不同应用的OpenUDID是不同的。