CFUUIDRef in an ARC world


For those using ARC, I believe the following method correctly/safely returns an NSString containing a UUID.

[code]- (NSString *)uuidString

CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
NSString *uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuid);

return uuidStr;


You can then use this method on page 235 to set your possession’s new imageKey:

// Set new image key. Use helper method. [possession setImageKey:[self uuidString]];


Worked for me. Thanks.