ios Presenting view controllers on detached view controllers is discouraged <BasicInfoVC: 0x7fb2dc24

出现的原因:

  在控制器A中添加控制器B--[A.view addSubView: B.view]

  在控制器B中弹出新的控制器时报此waring

解决:

[A addChildViewController:B];

[B.parentViewController presentViewController:alertController animated:YES completion:nil];

详见:http://stackoverflow.com/questions/19890761/warning-presenting-view-controllers-on-detached-view-controllers-is-discourage

时间: 2024-10-12 20:23:13

ios Presenting view controllers on detached view controllers is discouraged <BasicInfoVC: 0x7fb2dc24的相关文章

Presenting view controllers on detached view controllers is discouraged &lt;CallViewController: 0x14676e240&gt;.

今天在优化app时,发现程序出现这种警告:“ Presenting view controllers on detached view controllers is discouraged <CallViewController: 0x14676e240>. ” 首先说明一下,我是在判断无网络时,要弹出一个提示框时出现的这个问题 在网上查资料时,又说是当前控制器已present一个视图,再present一个视图时,就会出现这个错误.但是在我的项目中当前页面根本就没有第二个present了,因此

关于Presenting view controllers on detached view ...

使用模态跳转,Xcode有时候会出现 Presenting view controllers on detached view controllers is discouraged <SetViewController: 0x7fedb94f0f60>. 这样的警告代码,如果你认为你的层次之间没有问题(其实就是层次问题.present出来的模态窗口,禁止再使用present 来弹出其它的子窗口) 解决方法: 把 WithUsViewController *with=[[WithUsViewCo

Presenting view controllers on detached view controllers is discouraged

出现这个警告的原因是presentViewController的receiver是一个detached view controller.比方说:window有一个root view controller,然后我们把某个view controller(VC1)的view添加到了root view controller的subview上面,然后在VC1上面presentViewController.这时我们需要将VC1添加到root view controller的childController里面

ios: push viewcontroller 时出现Presenting view controllers on detached view controllers is discouraged 警告

原因:a,b,c 三个viewcontroller,a作为根视图,b.view 添加到a上,在b中模态(presentViewController)弹出c. 这种情况就会出现标题的警告 解决方法: 1. [self.view.window.rootViewControllerpresentViewController:controlleranimated:YEScompletion:nil]; /*这里一段解释 The reason of this warning is i was presen

【IOS笔记】Creating Custom Content View Controllers

Creating Custom Content View Controllers 自定义内容视图控制器 Custom content view controllers are the heart of your app. You use them to present your app’s unique content. All apps need at least one custom content view controller. Complex apps divide the workl

【IOS笔记】Resource Management in View Controllers

Resource Management in View Controllers 视图控制器的资源管理 View controllers are an essential part of managing your app’s resources. View controllers allow you to break your app up into multiple parts and instantiate only the parts that are needed. But more t

iOS Programming Autorotation, Popover Controllers, and Modal View Controllers

iOS Programming Autorotation, Popover Controllers, and Modal View Controllers? 自动旋转,Popover 控制器,Modal view controller? 1.? In this chapter, you are going to make four changes to Homepwner's behavior that will tailor the app's behavior to whatever dev

ios中创建可以拖动的view原理和实现详解

有时候我们会需要在界面上拖动view;uiview是继承于uiresponder的,所以可以响应触摸相关的事件. 重点是以下一组方法: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesEnded:(NSSet *)touches withEvent:(UIE

ios中创建可以拖动的view原理和实现详解(含代码)

有时候我们会需要在界面上拖动view;uiview是继承于uiresponder的,所以可以响应触摸相关的事件. 重点是以下一组方法: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event - (void)touchesEnded:(NSSet *)touches withEvent:(UIE