0

ViewController -> ModalViewController1 ---horizontalflip ---> ModalViewController2

So when 'Done' is touched in MVC2 to dismiss itself + a delegate method is called in MVC1 which does some stuff and then dismisses itself.

Problem is that this 'stuff' is already done before the animation dismissing MVC2 is complete. I'd like to be able to check when the animation is complete then dismiss MVC1.

4

2 回答 2

0

一旦 MVC2 的动画完成,MVC1 应该会收到一个 viewDidAppear。您可以根据您已经在做的委托调用设置的条件在其中做“东西”。

于 2012-04-19T20:21:33.603 回答
0

您应该能够使用委托来实现这一点。

在 MVC2.h 中

@protocal MVC2Delegate <NSObject>
@optional
  - (void) doneShowing;
@end

在 MVC2.m 中,您可以在点击“完成”时实现 IBAction 方法,在动作内部调用 doneShowing。

在 MVC1 中,你可以实现这个委托方法,在里面做任何你想做的事情,最后,调用[self dismissViewControllerAnimated:<#(BOOL)#> completion:<#^(void)completion#>]

于 2012-04-19T21:06:08.860 回答