Created
June 27, 2013 13:39
-
-
Save ewangke/5876485 to your computer and use it in GitHub Desktop.
UDID migration for unique identifier within a specific app
This file contains 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] objectForKey:kApplicationUUIDKey]; | |
if (!UUID) { | |
CFUUIDRef uuid = CFUUIDCreate(NULL); | |
UUID = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid); | |
CFRelease(uuid); | |
[[NSUserDefaults standardUserDefaults] setObject:UUID forKey:kApplicationUUIDKey]; | |
[[NSUserDefaults standardUserDefaults] synchronize]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment