Skip to content

Instantly share code, notes, and snippets.

@sugendran
Created February 12, 2013 21:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sugendran/4773412 to your computer and use it in GitHub Desktop.
Save sugendran/4773412 to your computer and use it in GitHub Desktop.
CREATE UUID in Objective-C with ARC
// CREATE UUID in Objective-C with ARC
NSString* createUUID()
{
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef uuidStr = CFUUIDCreateString(kCFAllocatorDefault, uuid);
NSString *result = [NSString stringWithString:(__bridge NSString*)uuidStr];
CFRelease(uuid);
CFRelease(uuidStr);
return result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment