I defined splitBarArr in .h 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: https://i.stack.imgur.com/3LMMZ.png
when assigning
retainproperty the retain count increments by 1. Henceallocing array does+1and assigning it to property viaselfdoes+1again. Thereleasein dealloc does-1so you still have+1left. Doing assigning like this will fix the problem: