3

I create a new project based on cocos2d-box2d, and there are always 4 warning in two files, one is CLScoreServerPost.m, the code has warning is following

[self addValue:[[UIDevice currentDevice] uniqueIdentifier] key:@"cc_device_id"];

and another is CLScoreServerRequest.m, the code has warning is following

device = [[UIDevice currentDevice] uniqueIdentifier];

both of them show the same warning: 'uniqueIdentifier' is deprecated

so what should I do? many thanks

CodeSmile
  • 64,284
  • 20
  • 132
  • 217
DaPo
  • 113
  • 1
  • 8
  • possible duplicate of [UIDevice uniqueIdentifier Deprecated - What To Do Now?](http://stackoverflow.com/questions/6993325/uidevice-uniqueidentifier-deprecated-what-to-do-now) – CodeSmile Nov 08 '11 at 14:26

2 Answers2

3
+(NSString *)GetUUID
{
    CFUUIDRef theUUID = CFUUIDCreate(NULL);
    CFStringRef string = CFUUIDCreateString(NULL, theUUID);
    CFRelease(theUUID);
    return [(NSString *)string autorelease];
}
v_1
  • 469
  • 7
  • 18
2

You can use for example OpenUDID https://github.com/ylechelle/OpenUDID

As LearnCocos2D told in a comment there is also a topic on SOF : UIDevice uniqueIdentifier Deprecated - What To Do Now?

Community
  • 1
  • 1
jptsetung
  • 9,064
  • 3
  • 43
  • 55