I had a similar problem in the last project. For me, the problem was hidden in a hidden statement about saving the delegate property, which kept the save account, which caused the point of view not to be deleted.
Try this troubleshooting technique ..... presumably you might have a uinavigation controller pushing / displaying controllers.
Consider that there is something in the view that holds the save count, forcing the view to remain in memory (even if the view popped up and you issued the release statement). Another symptom (not related to this problem, but related to this, if you use all view controllers, you might even have a crash in the application.)
So, in the dealloc methods of the view controller (s), execute the log statement on the hold account of the corresponding type. (and other objects that you synthesize.) for example.
UiNavController -Level0ViewController -(void)dealloc{ // HERE TEST FOR RETAIN COUNT OF 2 (2 = one for the alloc / one for the addSubview) DLog(@"level0view retain count: :%@",[level0view retainCount]); [level0view release]; // this will make retain count 1. [super dealloc]; -- Level0View -(void)dealloc{ DLog(@"dealloc"); // set break points here and confirm this is being called. } -- SomeImageView.h // for me my problem lied here with the infringing line below being RETAIN! it should have been assign. changing this successfully resolved app crash and memory leak. @property(retain) id delegate
PS check DLog Karl Kroft is a very good log that gives you the class line number and hides the guff that NSLog usually adds.
source share