When ‘Analyse’, Got warning “Incorrect decrement of the reference count of an object that is not owned at this point by the caller” in this. (xCode 4.1+)
I can understant that it’s better to “kill” an object from it’s proper class, but is there a way to do it from outside without a warning?
Thanks!
NSLog(@"--[%s:%d]",__PRETTY_FUNCTION__, __LINE__);
myAppDelegate* appDelegate = [[UIApplication sharedApplication] delegate];
if (appDelegate.referencesPopup != nil) {
[appDelegate.referencesPopup release]; // warning
appDelegate.referencesPopup = nil;
}
}
Most likely, the way in which you are acquiring the object being stored in
referencesPopup, you did not allocate it yourself or retain it. In that case, you are not responsible for releasing it. You can simply set the ivar to nil.