iOS---[UIDevice identifierForVendor]慎用!

来源:互联网 发布:文字识别软件免费版 编辑:程序博客网 时间:2024/05/18 01:26

An alphanumeric string that uniquely identifies a device to the app’s vendor. (read-only)

用于唯一标示设备的字母数字字符串,每一个供应商都不同呀


Declaration

OBJECTIVE-C

@property(nonatomic, readonly, strong) NSUUID *identifierForVendor

Discussion

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.

对于运行于同一个设备,并且来自同一个供应商的所有App,这个值都是相同的。对于一个设备上来自不同供应商的app,这个值不同;不同设备的app,无论供应商相同与否,这个值都不同。


If the value is nil, wait and get the value again later. This happens, for example, after the device has been restarted but before the user has unlocked the device.

如果此值为空,等一会再去获取。用户锁定设备后,再重启设备,此时获取为空,需要解锁。

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. 

当在设备上安装来自同一个供应商的不同App时,此值保持不变。如果你删除了来自某个供应商的所有app,再重新安装时,此值会改变。


请注意,这个属性只能在iOS6之后使用!

0 0