Any idea why this code gives me a memory leak? As you can see, I'm running out of ideas as to what I can do to stop it.
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
NSArray *allSketches = [project.sketches allObjects];
NSMutableArray *temp = [[NSMutableArray alloc] initWithArray:allSketches];
if(sketchesArray != nil) [sketchesArray release];
[self setSketchesArray:temp];
[allSketches release];
allSketches = nil;
[temp release];
temp = nil;
}
I also release sketchesArray inside viewDidDissapear. I'm not using viewDidLoad and dealloc to init/release these objects as what I am doing requires me to use viewWillAppear and viewDidDissapear.
Thanks