IPhone. Why did the static analyzer not understand this?

@property(nonatomic, retain) NSMutableArray* playerList; 

...

 team.playerList = [[NSMutableArray alloc] initWithArray:self.playerList]; 

Is it a memory leak right?

So why couldn't the static analyzer choose this?

+6
memory-management ios objective-c iphone static-analysis
source share
1 answer

Yes, it is a memory leak; you need to either auto-detect this array or manually release it after setting the property. I'm not sure why the static analyzer skipped it - you might consider throwing an error regarding developer tools.

+3
source share

All Articles