I`m getting the following warning.
Reference-counted object is used after it is released
ARC is enabled for this file.
I have not converted my app to use ARC and don`t have an proper understanding of it at this time. However, at a glance I am puzzled why this code should have a problem (its from a library), I mean I know autorelease should not be used here?
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
id uuid = [defaults objectForKey:@"uniqueID"];
if (uuid)
uniqueID = (NSString *)uuid;
else {
CFStringRef cfUuid = CFUUIDCreateString(NULL, CFUUIDCreate(NULL));
uniqueID = (__bridge NSString *)cfUuid;
CFRelease(cfUuid);
[defaults setObject:uniqueID forKey:@"uniqueID"]; // warning here
}
EDIT
@JohnCalsbeek, @epatel, @Chuck
Thanks, I’ve just tried that and I get a new warning on CFStringRef cfUuid line, saying potential leak.
Heres the full file https://github.com/MugunthKumar/MKStoreKit/blob/master/MKSKProduct.m
Try this one, srry for the miss understanding haha