加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 在分离的视图控制器上呈现视图控制器是不鼓励的

发布时间:2020-12-15 01:54:17 所属栏目:百科 来源:网络整理
导读:我正在使用xcode 5.1.1与故事板。我在主菜单上有一个按钮,并使用此代码弹出到另一个视图控制器 VC *secondVC = [[VC alloc] init];[self presentViewController:secondVC animated:YES completion: nil]; 那里我有这个代码的返回按钮 [self dismissViewCont
我正在使用xcode 5.1.1与故事板。我在主菜单上有一个按钮,并使用此代码弹出到另一个视图控制器

VC *secondVC = [[VC alloc] init];
[self presentViewController:secondVC animated:YES completion: nil];

那里我有这个代码的返回按钮

[self dismissViewControllerAnimated:YES completion: nil];

而当我弹出二维码xcode给我的时候是错误的:

Presenting view controllers on detached view controllers is discourage <UINavigationController: 0x8c94510>.

我也有旋转问题,它不能正常工作。

解决方法

如果您想在viewWillAppear中推送,呈现或弹出视图控制器,则会出现此警告。我不知道你的代码是什么,所以很难确定你的问题,但尝试使用这个,如果你试图在viewWillAppear中显示新的视图。

[self performSelector:@selector(yourMethod)
               withObject:nil afterDelay:0.0];

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读