This used to be a thing until the iOS 6 and OS X 10.8 compatible NSUUID Class became available.
NewThis is how you can do it now:
Here’s a method you can put in a class, with the correct ARC casts on ownership, that returns a UUID. It’s a fairly common technique, and you’ll even see versions of it where people have created a category on NSString for this.
And to use it:
A common use for unique strings is to name files and directories within a program so that they do not clash. Since iOS 2 and OS X 10.0 there has been the
globallyUniqueString method in NSProcessInfo which returns a string that is unique for the network and process. So, for a good enough unique string this is probably a better method to use: