xocde8打印出:Presenting view controllers on detached view controllers is discouraged
原因:
是某个viewController的生命周期控制出现了错误,所以尽量避免一个controller的view去addsubview另一个controller的view,这样会破坏层级关系,导致第一controller不能控制另一个controller的生命周期。
解决办法:
在presentViewController,需要添加 [mainVC addChildViewController:VC];
//先添加到主控制器
[self addChildViewController:vc];
//再先添加到主控制器的视图里面
[self.view addSubview:vc.view];
或者修改:
[self.parentViewController presentViewController:viewController animated:YES completion:nil]; 或
[self.view.window.rootViewController pushViewController:YOUR_VIEW_CONTROLER animated:YES];
xocde8打印出:Presenting view controllers on detached view controllers is discouraged的更多相关文章
- Presenting view controllers on detached view controllers is discouraged <CallViewController: 0x14676e240>.
今天在优化app时,发现程序出现这种警告:“ Presenting view controllers on detached view controllers is discouraged <C ...
- Presenting view controllers on detached view controllers is discouraged
本文转载至 http://www.xuebuyuan.com/2117943.html Presenting view controllers on detached view controllers ...
- iOS错误之-Presenting view controllers on detached view controllers is discouraged
遇到这个警告后找了一下网络资源,基本上只说通过 [self.view.window.rootViewController presentViewController:controller animat ...
- iOS Programming Autorotation, Popover Controllers, and Modal View Controllers
iOS Programming Autorotation, Popover Controllers, and Modal View Controllers 自动旋转,Popover 控制器,Moda ...
- 创建控制器的方法、控制器加载view过程、控制器view的生命周期、多控制器组合
在介绍四大对象的那篇博客中,可以基本了解到程序启动的过程: main-->UIApplicationMain-->创建UIApplication的实例和app代理AppDelegate的实 ...
- 获取View的截图-将View转换为Bitmap对象
开发中,有时候需要获取View的截图来做动画来达到动画流程的目的 原理:将View的内容画到一个Bitmap画布上,然后取出 下面封装了一个从View生成Bitmap的工具类 /** * 将View转 ...
- The method onClick(View) of type new View.OnClickListener(){} must override a superclass
最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ok —————— 最近在做一个jWebSocket Android客户端的Demo时遇到如下错误: ".. ...
- (转)Qt Model/View 学习笔记 (五)——View 类
Qt Model/View 学习笔记 (五) View 类 概念 在model/view架构中,view从model中获得数据项然后显示给用户.数据显示的方式不必与model提供的表示方式相同,可以与 ...
- onClick(View) of type new View.OnClickListener(){} must override a superclass method
原地址:http://blog.csdn.net/aeolus1019/article/details/8014798 Android开发过程中代码错误报错如下: - implements andro ...
随机推荐
- Java 基本的递归写法
1.首先我们得有一个树状结构的表,类似这种结构.必须得有 id,pid 其他的根据需要来. 我们叫它treeTbl表吧.这里pid为0的表示是顶级节点. 2.接着select * from tree ...
- 开源作品-PHP写的Redis管理工具(单文件绿色版)-SuRedisAdmin_PHP_1_0
前言:项目开发用到了Redis,但是在调试Redis数据的时候,没有一款通用的可视化管理工具.在网络找了一些,但是感觉功能上都不尽人意,于是决定抽出一点时间,开发一个用起来顺手的Redis管理工具.秉 ...
- 偏函数应用(Partial Application)和函数柯里化(Currying)
偏函数应用指的是固化函数的一个或一些参数,从而产生一个新的函数.比如我们有一个记录日志的函数: 1: def log(level, message): 2: print level + ": ...
- Kind (type theory)-higher-kinded types--type constructor
, pronounced "type", is the kind of all data types seen as nullary type constructors, and ...
- apicloud 第三方登录授权、微信、扣扣、微博登录授权
授权登录.接入第三方的配置 例如:微信的登录授权. 首先在模块里面添加 wx 这个模块,然后在项目的配置文件里面进行配置. 配置的时候要现在微信开放平台 https://open.weixin.qq. ...
- 小程序text组件内部上边距的问题
index.wxml: <view class="slogan"> <text> 建立跨文化的全球视野,做世界公民 </text> </v ...
- kvm之 virt-install工具命令详解
一.virt-install是一个命令行工具,它能够为KVM.Xen或其它支持libvrit API的hypervisor创建虚拟机并完成GuestOS安装:此外,它能够基于串行控制台.VNC或SDL ...
- JavaScript、Dom和jQuery
var obj=document.getElementById('t1') obj.innerText obj.innerHTML 1.javascript 插入代码如下: <script ty ...
- python-selenium,关于页面滑动
第一种: #滑到底部 js="var q=document.documentElement.scrollTop=100000" driver.execut_script(js) 目 ...
- loadrunner安装方法
1.loadrunner安装网盘地址: http://pan.baidu.com/s/1hrP6mDQ 一般会提示:“vc2005_sp1_with_atl_fix_redist 2.确认时提示缺少 ...