我试图在另一个视图以模态方式呈现后直接显示模态视图(第二个是出现的加载视图).
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
// Show load
LoadViewController *loader = [[LoadViewController alloc] init];
[self presentModalViewController: loader animated:NO];
[loader release];
}
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时,我得到一个"程序接收信号:"EXC_BAD_ACCESS"." 错误.
堆栈跟踪是:
0 0x30b43234 in -[UIWindowController transitionViewDidComplete:fromView:toView:]
1 0x3095828e in -[UITransitionView notifyDidCompleteTransition:]
2 0x3091af0d in -[UIViewAnimationState sendDelegateAnimationDidStop:finished:]
3 0x3091ad7c in -[UIViewAnimationState animationDidStop:finished:]
4 0x0051e331 in run_animation_callbacks
5 0x0051e109 in CA::timer_callback
6 0x302454a0 in CFRunLoopRunSpecific
7 0x30244628 in CFRunLoopRunInMode
8 0x32044c31 in GSEventRunModal
9 0x32044cf6 in GSEventRun
10 0x309021ee in UIApplicationMain
11 0x00002154 in main at main.m:14
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?我完全难过了!加载视图为空,因此肯定没有任何事情导致错误.是否与在同一个事件循环中以模态方式启动2个视图有关? …