objective c - How to remove previous ViewController? -
objective c - How to remove previous ViewController? -
seeking help.
my project: create book children. every page custom viewcontroller. on every page have button next , previous page. when nextpage-button pressed "switch"/add viewcontroller in appdelegate this:
- (void)gotonextpage2 { self.view2 = [[viewcontroller2 alloc] init]; view2.view.frame = cgrectmake(769, 0, 768, 1024); [window addsubview:view2.view]; [uiview beginanimations:nil context:null]; [uiview setanimationcurve:uiviewanimationcurveeaseinout]; [uiview setanimationduration:0.5]; view2.view.frame = cgrectmake(0, 0, 768, 1024); [uiview commitanimations]; }
how , remove previous viewcontroller? in case viewcontroller1. idea?
thanks in advance planky
you didn't provide much information... anyway, might help.
in animation code:
[uiview setanimationdelegate:self]; [uiview setanimationdidstopselector:@selector(animationdidstop:finished:context:)];
and add together remove viewcontroller:
- (void)animationdidstop:(nsstring *)animationid finished:(nsnumber *)finished context:(void *)context { [self.view1.view removefromsuperview]; self.view1 = nil; }
objective-c xcode uiview viewcontroller
Comments
Post a Comment