Quote:
Originally Posted by jsd
You need to retain optionsViewController and navControllerSettings (although I'd probably use autorelease in this case.)
Very simple rules for memory management in Cocoa
Code:
optionsViewController *optionsView = [[[optionsViewController alloc] initWithNibName:@"optionsView" bundle:nil] autorelease];
navControllerSettings = [[[UINavigationController alloc] initWithRootViewController:(UIViewController *) optionsView] autorelease];
I'm far from a Cocoa memory management expert but I do know one key rule: If you alloc/init something, you MUST follow up with retain/release or autorelease. Put that on a sticky on the side of your monitor.
|
Hi,
Thanks for the reply, but this won't helped me. It is still crashing. I tried with retain, autorelease and release.
Vishal N