objective c - Using dealloc method to release -
i'm trying understand memory management better apps, stopped @ 1 point :
i use uibuttons
. alloc them, work them etc. need release them @ 1 moment. implement dealloc
method object usefull time uiviewcontroller
on screen, , need released when desappeard. in uiviewcontroller
implement :
-(void)dealloc { nslog(@"dealloc call"); [mybutton release]; .... //some objects release [super dealloc]; }
but never see dealloc call printed, think doesn't passed dealloc
method when uiviewcontroller
desappeard.
so, how work ? / false ?
thanks !
edit : method change of viewcontroller :
-(void)mymethod { if (!nextviewcontroller) { nextviewcontroller = [[nextviewcontroller alloc]init]; } uiview *nextview = nextviewcontroller.view; uiview *actualview = actualviewcontroller.view; [actualviewcontroller viewwillappear:no]; [nextviewcontroller viewwilldisappear:no]; [actualview removefromsuperview]; [self.view addsubview:nextview]; [actualviewcontroller viewdidappear:no]; [nextviewcontroller viewdiddisappear:no]; }
Comments
Post a Comment