iphone - Releasing root view controller -
i have following statement inside
- (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions the statement :
root_view_controller = [[root_view_controller alloc] initwithnibname:@"base_view" bundle : nil]; i not using arc, thinking of releasing root_view_controller in
- (void)applicationwillterminate:(uiapplication *)application my question : above practice ok ? , : there other clean code should added before releasing root_view_controller ?
appdelegate.m
- (void)dealloc { [_window release]; [_viewcontroller release]; [super dealloc]; } - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.window = [[[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]] autorelease]; // override point customization after application launch. self.viewcontroller = [[[mlviewcontroller alloc] initwithnibname:@"mlviewcontroller" bundle:nil] autorelease]; self.window.rootviewcontroller = self.viewcontroller; [self.window makekeyandvisible]; return yes; } if want release root_view_controller need in dealloc method code above
Comments
Post a Comment