Hello,
I have struggled with this before and I hope that I have it correct now? The issue is about viewDidUnload and what variables to release, set to nit etc in this method. As I understand a memorywarning will lead to this method and afterwards the view will be loaded again. So, the variables I have released etc are all allocated or retained or IBOutlets... I have set some comments in the method inorder to show how they are retaiend/allocated.
So, what do you think?
Thanks in adevance!
MACloop
I have struggled with this before and I hope that I have it correct now? The issue is about viewDidUnload and what variables to release, set to nit etc in this method. As I understand a memorywarning will lead to this method and afterwards the view will be loaded again. So, the variables I have released etc are all allocated or retained or IBOutlets... I have set some comments in the method inorder to show how they are retaiend/allocated.
So, what do you think?
Code:
- (void)viewDidUnload {
[self.theStringInfoArray release];//is allocated in the init method, has a property with assign in .h-file
[self.locManager release];/is allocated in the init method, has a property with assign in .h-file
[self.infoPopoverController release];/is assigned in the viewDidLoad method, has a property with retain in .h-file
[startMap release];//is a IBOutlet with a property retain
theLoader = nil;//is a IBOutlet with no property, is not retained or alloced in the class - only used like [theLoader stopAnimating]
}
- (void) dealloc {
[theStringInfoArray release];
[locManager release];
[infoPopoverController release];
[startMap release];
[theLoader release];
[super dealloc];
}
Thanks in adevance!
MACloop