已结束。此问题不符合
Stack Overflow guidelines .它目前不接受答案。
Best Answer-推荐答案 strong>
像这样:
@interface UIDevice (UIDeviceAppIdentifier)
@property (readonly) NSString *deviceApplicationIdentifier;
@end
@implementation UIDevice (UIDeviceAppIdentifier)
- (NSString *) deviceApplicationIdentifier
{
static NSString *name = @"a string identifying your application, like its name";
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *value = [defaults objectForKey: name];
if (!value)
{
value = (NSString *) CFUUIDCreateString (NULL, CFUUIDCreate(NULL));
[defaults setObject: value forKey: name];
[defaults synchronize]; // handle error
}
return value;
}
@end
iOS 文档或多或少描述了使用 CFUUIDCreate() 创建标识符并建议使用 UserDefaults 来存储它。
关于objective-c - nomore UDID - 如何存储每个设备的推送通知设置?,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/10037089/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) |
Powered by Discuz! X3.4 |