0
我在我的应用程序的代码做一个视图控制器IOS:一个的viewController
SecondViewController *second = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
[self.view addSubview:second.view];
[second.view setFrame:CGRectMake(320, 0, 320, 480)];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.40]; //the double represents seconds
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[second.view setFrame:CGRectMake(0, 0, 320, 480)];
[UIView commitAnimations];
的过渡,它做工精细定制化; 但里面第二个视图控制器我有这样的代码消失这个视图 - 控制
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.40]; //the double represents seconds
[UIView setAnimationDelegate:self];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[self.view setFrame:CGRectMake(320, 0, 320, 480)];
[UIView commitAnimations];
它做工精细,但什么是释放的方式,我在哪里可以释放第二个,我的Alloc当我把它? 如果我写[self.view removeFromSuperView] ??是否发布?
,但我不明白的地方我可以释放它...因为如果我释放它,当我用第一个动画显示第二个,当我关闭它时说我已经释放... – CrazyDev
你需要在隐藏第二个视图(控制器的视图)之后释放控制器 – Lefteris
ok ...例如在viewwillappear中firstviewcontroller ......不是吗? – CrazyDev