Presenting view controllers on detached view controllers is discouraged <CallViewController: 0x14676e240>.

今天在优化app时,发现程序出现这种警告:“

Presenting view controllers on detached view controllers is discouraged <CallViewController: 0x14676e240>.

首先说明一下,我是在判断无网络时,要弹出一个提示框时出现的这个问题

在网上查资料时,又说是当前控制器已present一个视图,再present一个视图时,就会出现这个错误。但是在我的项目中当前页面根本就没有第二个present了,因此也就不存在present多个视图了。通过摸索,我是这样解决问题的:

将present操作放在线程中执行就OK了。

不过,,问题虽然解决了,但是我却并不知道这是什么原因导致的,按理说不将present操作放在线程中也对啊,因为之前是没有present操作的,我很是纠结,希望有解决此问题、并看到我此次小结的大神知道一番!

时间: 2024-08-09 07:58:40

Presenting view controllers on detached view controllers is discouraged <CallViewController: 0x14676e240>.的相关文章

关于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 Presenting view controllers on detached view controllers is discouraged &lt;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/warni

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

创建控制器、控制器加载view过程、控制器view的生命周期、多控制器

在介绍四大对象的那篇博客中,可以基本了解到程序启动的过程: main-->UIApplicationMain-->创建UIApplication的实例和app代理AppDelegate的实例并设置好代理--->在程序启动后,也就是启动画面显示之后, AppDelegate创建UIWindow(可以是自动创建的,也可以手动创建) 现在讨论的问题是,如何创建控制器并设置为UIWindow的根控制器,然后加载出控制器中的view并显示出来. 本文目录 1.创建控制器的三种方式 2.控制器的vi

在ASP.NET MVC中使用Knockout实践02,组合View Model成员、Select绑定、通过构造器创建View Model,扩展View Model方法

本篇体验使用ko.computed(fn)计算.组合View Model成员.Select元素的绑定.使用构造器创建View Model.通过View Model的原型(Prototype)为View Model添加扩展方法. □ 使用ko.computed(fn)计算成员 有时候,我们希望把View Model中的几个成员组合起来成为一个新成员,使用ko.computed(fn)可实现. 接着上一篇,为productViewModel这个json对象增加一个计算成员. <div data-bi

eclise -The method onClick(View) of type new View.OnClickListener(){} must override a superclass method

在做arcgis android开发的时候,突然遇到这种错误,The method onClick(View) of type new View.OnClickListener(){} must override a superclass method. 这看起来确实很奇怪,网上搜了一下,解决方案是将 eclipse制定版本从1.7改为1.6即可. 在 eclipse中,windows->references->java->java compiler中设置.

Android View系统分析之二View与ViewGroup

目录 在Android View系统分析之从setContentView说开来(一)一文中,我们从setContentView开始阐述了Android中的视图层次,从设置内容布局到整个视图层次的建立的过程.并且对View和ViewGroup的关系进行了简单的介绍,今天我们继续来深入的了解Android中的View和ViewGroup. ViewGroup与View的关系 我们在定义一个布局时,在它的顶层通常都是使用LinearLayout或者RelativeLayout等组件来包装一些子控件,例