
-(Nsstring*)uniqID{ Nsstring* uniqueIDentifIEr = nil; if( [UIDevice instancesRespondToSelector:@selector(IDentifIErForvendor)] ) { // iOS 6+ uniqueIDentifIEr = [[[UIDevice currentDevice] IDentifIErForvendor] UUIDString]; } else { // before iOS 6,so just generate an IDentifIEr and store it uniqueIDentifIEr = [[NSUserDefaults standardUserDefaults] objectForKey:@"IDentifIErForvendor"]; if( !uniqueIDentifIEr ) { CFUUIDRef uuID = CFUUIDCreate(NulL); uniqueIDentifIEr = ( Nsstring*)CFUUIDCreateString(NulL,uuID); CFRelease(uuID); [[NSUserDefaults standardUserDefaults] setobject:uniqueIDentifIEr forKey:@"IDentifIErForvendor"]; } }return uniqueIDentifIEr;}// UPDATE
正如Leon LucardIE所言,他是对的
总结IDentifIErForvendor will change after app uninstall/reinstall. See here 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.
以上是内存溢出为你收集整理的IOS7中的UDID替换全部内容,希望文章能够帮你解决IOS7中的UDID替换所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)