Created
March 30, 2012 08:51
-
-
Save wjlafrance/2249975 to your computer and use it in GitHub Desktop.
Use you a CFUUID! No ARC for you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *uuid = [[NSUserDefaults standardUserDefaults] stringForKey:@"CFUUID"]; | |
if (!uuid) { | |
CFUUIDRef cfuuid = CFUUIDCreate(NULL); | |
uuid = [(NSString *)CFUUIDCreateString(NULL, cfuuid) autorelease]; | |
[[NSUserDefaults standardUserDefaults] setValue:uuid forKey:@"CFUUID"]; | |
[[NSUserDefaults standardUserDefaults] synchronize]; | |
CFRelease(cfuuid); | |
} | |
NSLog(@"UUID: %@", uuid); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment