Unique identifier for an iPhone app

后端 未结 13 1250
南笙
南笙 2020-11-29 18:33

For an iPhone app that submits images to a server I need somehow to tie all the images from a particular phone together. With every submit I\'d like to send some unique pho

13条回答
  •  旧巷少年郎
    2020-11-29 18:56

    You can also use CFUUID to generate a UUID. Here's some code:

    NSString *uuid = nil;
    CFUUIDRef theUUID = CFUUIDCreate(kCFAllocatorDefault);
    if (theUUID) {
      uuid = NSMakeCollectable(CFUUIDCreateString(kCFAllocatorDefault, theUUID));
      [uuid autorelease];
      CFRelease(theUUID);
    }
    

提交回复
热议问题