Skip to content

Instantly share code, notes, and snippets.

@jdriscoll
Created September 26, 2012 13:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jdriscoll/3788187 to your computer and use it in GitHub Desktop.
Save jdriscoll/3788187 to your computer and use it in GitHub Desktop.
NSString+UUID
#import "NSString+UUID.h"
@implementation NSString (UUID)
+ (NSString *)UUIDString
{
CFUUIDRef UUID = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, UUID);
CFRelease(UUID);
return (__bridge_transfer NSString *)string;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment