I am creating a NSString like this, should I release it afterwards or not?
CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *device = (NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
Thanks!
I am creating a NSString like this, should I release it afterwards or not?
CFUUIDRef uuidObj = CFUUIDCreate(nil);
NSString *device = (NSString*)CFUUIDCreateString(nil, uuidObj);
CFRelease(uuidObj);
Thanks!
Here is documentation for this function:
CFUUID Reference - CFUUIDCreateString
and it states that ownership follows The Create Rule.
Here are some more links with answer:
CFUUIDRef theUUID = CFUUIDCreate(NULL);
NSString *s2ndUuid = (__bridge_transfer NSString*)CFUUIDCreateString(kCFAllocatorDefault, theUUID);