Tag: xcode7 presentviewcontroller

实例化模式视图控制器冻结应用程序 – 可能的问题与Xcode 7

我在iOS应用程序中以模态方式呈现视图控制器。 问题是没有崩溃,应用程序冻结一旦presentViewController:animated被调用。 统计数据显示CPU使用率为100%,即使手动closures应用程序,使用率也不会下降。 UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; CustomModalViewController *vvc = [sb instantiateViewControllerWithIdentifier:@"CustomModalViewController"]; if(!vvc){ NSLog(@"ERROR!!! vvc is null"); } NSLog(@"instantiate modal view controller"); vvc.providesPresentationContextTransitionStyle = YES; vvc.definesPresentationContext = YES; vvc.data = data; NSLog(@"before presenting modal view controller"); [vvc setModalPresentationStyle:UIModalPresentationOverCurrentContext]; [self presentViewController:vvc animated:YES completion:nil]; 我试图在自定义类的viewDidLoad中打印一些debugging语句,但是这些也没有被调用。 我不明白为什么视图控制器没有被显示。 任何帮助将不胜感激。 我想知道在什么情况下你的应用程序进入无限循环推视图控制器或是由于其他原因? 更新: 我更新到XCode 7后发生这个错误。不知道,但我想这可能是一个新的SDK – UIKit或LLVM编译器的问题。 我复制我的项目到Xcode 6.4的另一个mac和错误消失! […]