I made a static mainmenu with a TableView. Sometimes it crashes because my Subview has allready deallocated a subview.
Is also ok to release a View in the dealloc method of the local object instead of that:
[NavController pushViewController:self.AnotherView animated:YES];
[self.AnotherView release]; //This line into (void)viewDidLoad
AnotherView is defined in the headerfile as property and also synchronozed in the .m-File
When i use the dealloc way it works great on the device, but I need to know if this is correct.
You only call release for objects you
initorallocyourself. If it is a property of your class thenreleasein thedeallocof your class.So in your case, unless you
initanotherViewa few lines above your sample code (same method), callingreleaseon it where you are is going to cause a leak/SIG_ABORT because you have done so prematurely.Feel free to post more code, particularly how anotherView is assigned and you may get a more specific answer.