Since upgrading to Lion and therefore Xcode 4.1
When I start the analyzer, I get dozens of "potential memory leaks."
I would usually use a property list as follows:
@synthesize indexPath = _indexPath;
- (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle {
self = [super initWithNibName:nibName bundle:nibBundle];
self.indexPath = [[NSIndexPath alloc] init];
[_indexPath release];
return self;
}
and in the dealloc () method:
- (void)dealloc {
[_indexPath release];
[super dealloc];
}
Now, the analysis will show me a scary blue message on self.indexPath that says there is a leak. When obviously not.
How do you isolate and format your code so that Xcode doesn't consider it a leak? (saving property alias self.var vs _var)
Thank...
source
share