iPhone-解散以前的modalviewControllerAnimation:是的,然后弹出新的ModalViewControllerAnimation:是 - 失败
-
24-10-2019 - |
题
我有一个主窗口弹出模态视图控制器。在此模态视图控制器中完成时,它将返回到主窗口,然后自行自行解散。然后,主窗口弹出一个带有Animated = Yes的新模态视图控制器。
问题在于,在第一个ModalViewController内部完成的解散调用适用于两者,而SecondController则从未显示。
在父母呼叫之前或之后,将第一个解雇没有更改任何内容。如果第一次解雇设置为wih wih = no,则一切正常。但是我需要动画。
main.m
- (void) entry {
FirstController *nextWindow = [[FirstController alloc] initWithNibName:@"theNIB" bundle:nil];
nextWindow.caller = self;
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:nextWindow];
[self.navigationController presentModalViewController:navController animated:YES];
[nextWindow release];
[navController release];
}
- (void) thingsDoneInFirstModalController:(OBJECT)returnValue retval2:(OBJECT2)returnValue2 {
[self display2ndController];
}
- (void) display2ndController {
SecondController *nextWindow;
nextWindow = [[SecondController alloc] initWithNibName:@"NIB2" bundle:nil];
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:nextWindow];
[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
[nextWindow release];
}
1st modalviewcontroller.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self.navigationController dismissModalViewControllerAnimated:YES];
[self.caller thingsDoneInFirstModalController:theResult retval2:someMoreResult];
}
我该怎么办?我不想在视图中捕捉任何东西。
为什么不从同一导航控制器中调用菌落?
解决方案
当您解散动画时,原因可能是动画。尝试使用第二种模态窗口 performSelector:withObject:afterDelay:
, ,一种从 NSObject
. 。参考 这里.
不隶属于 StackOverflow