The following singleton class (SharedManager) helper method might be causing a retain cycle. Getting warnings in static analyzer: "Potential leak of an object allocated at line ..." How can I fix?
I did try making ivar uuid __weak but warning still appears when I analyze.
NSString *__weak uuid = (__bridge NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuidObject);
Thanks
Being called in the class like so:
myUUID = [SharedManager generateUUID];
+ (NSString *)generateUUID
{
CFUUIDRef uuidObject = CFUUIDCreate(kCFAllocatorDefault);
NSString *uuid = (__bridge NSString *)CFUUIDCreateString(kCFAllocatorDefault, uuidObject);
CFRelease(uuidObject);
return uuid;
}
Here is a way to release them:
Source: http://www.cocoabuilder.com/archive/cocoa/217665-how-to-create-guid.html
Does that remove the warning?