首页 > 其他 > 详细

关于Presenting view controllers on detached view ...

时间:2015-08-27 11:26:54      阅读:217      评论:0      收藏:0      [点我收藏+]

使用模态跳转,Xcode有时候会出现

Presenting view controllers on detached view controllers is discouraged <SetViewController: 0x7fedb94f0f60>.

这样的警告代码,如果你认为你的层次之间没有问题(其实就是层次问题。present出来的模态窗口,禁止再使用present 来弹出其它的子窗口)

解决方法:

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:^{    
    }];

即可

关于Presenting view controllers on detached view ...

原文:http://my.oschina.net/rainwz/blog/497697

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!