From: http://blog.prosight.me/index.php/2010/11/670
UUID is a 128-bit value, which guarantees uniqueness. Generally, it is generated by the MAC address of the machine's Nic and the current system time.
UUID is a string connected by a hyphen. Example: 13222F23-C76A-7781-0C12-0293E3B34398.
The following method generates a UUID and returns it as a string.
-(NSString *) createUUID
{
// Create universally unique identifier (object)
CFUUIDRef uuidObject = CFUUIDCreate (kCFAllocatorDefault );
// Get the string representation of CFUUID object.
NSString * uuidStr = (NSString *) CFUUIDCreateString (kCFAllocatorDefault, uuidObject );
// If needed, here is how to get a representation in bytes, returned as a structure
// Typedef struct {
// UInt8 byte0;
// UInt8 byte1;
//...
// UInt8 byte15;
//} CFUUIDBytes;
CFUUIDBytes bytes = cfuuidgetuidbytes (uuidObject );
CFRelease (uuidObject );
Return uuidStr;
}