-
-
Save cokecoffe/9544039 to your computer and use it in GitHub Desktop.
生成唯一标识,可以作为文件或路径名。
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 *)GUID | |
{ | |
CFUUIDRef theUUID = CFUUIDCreate(NULL); | |
CFStringRef theString = CFUUIDCreateString(NULL, theUUID); | |
NSString *unique = [NSString stringWithString:(__bridge id)theString]; | |
CFRelease(theString); CFRelease(theUUID); // Cleanup CF objects | |
return unique; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment