Looks good. This is what I use (available as gist )
- (NSString *)uuidString {
Edited to add
If you are on OS X 10.8 or iOS 6, you can use the new NSUUID class to generate the UUID string without having to go to Core Foundation:
NSString *uuidString = [[NSUUID UUID] UUIDString];
But basically, if you just want to create a unique string for a file or directory name, you can use the NSProcessInfo globallyUniqueString method, for example:
NSString *uuidString = [[NSProcessInfo processInfo] globallyUniqueString];
This is not a formal UUID, but it is unique to your network and your process and is a good choice for many cases.
Abizern May 6 '12 at 8:32 AM 2012-05-06 08:32
source share