Skip to content

Instantly share code, notes, and snippets.

@jagbolanos
Created July 16, 2012 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jagbolanos/3125548 to your computer and use it in GitHub Desktop.
Save jagbolanos/3125548 to your computer and use it in GitHub Desktop.
Create Unique ID
+ (NSString*) getUniqueID {
CFUUIDRef newUniqueId = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef newUniqueIdString = CFUUIDCreateString(kCFAllocatorDefault, newUniqueId);
NSString *uniqueId = [NSString stringWithFormat:@"%@",(NSString *)newUniqueIdString];
CFRelease(newUniqueId);
CFRelease(newUniqueIdString);
return [[uniqueId retain] autorelease];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment