使用模态跳转,Xcode有时候会出现code
Presenting view controllers on detached view controllers is discouraged <SetViewController: 0x7fedb94f0f60>.
这样的警告代码,若是你认为你的层次之间没有问题(其实就是层次问题。present出来的模态窗口,禁止再使用present 来弹出其它的子窗口)it
解决方法:io
把class
WithUsViewController *with=[[WithUsViewController alloc]init]; [self presentViewController:with animated:YES completion:nil];
改成:方法
AppDelegate *delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; WithUsViewController *with=[[WithUsViewController alloc]init]; [delegate.window.rootViewController presentViewController:with animated:YES completion:^{ }];
便可
im