I defined splitBarArr in .h开发者_Go百科 file:
@property (nonatomic, retain) NSMutableArray *splitBarArr;
And I also set it nil in viewDidUnload, and released it in dealloc.
Why XCode still say that it's a potential memory leak?
Img here: http://i.stack.imgur.com/3LMMZ.png
when assigning retain
property the retain count increments by 1. Hence alloc
ing array does +1
and assigning it to property via self
does +1
again. The release
in dealloc does -1
so you still have +1
left. Doing assigning like this will fix the problem:
self.splitBarArr = [NSMutableArray array];
精彩评论