昨天 调试程序 已经快要上线了 突然有个BUG 找了半天 才找到是因为这个警告 但是 解决这个警告又花了一天的时间 试了各种消除控制器的方法 都不可用 其中

并且 有这个bug  手机真机测试完全没问题  只有在iPad上 有这个警告 就会出问题

第一个解决办法  试了下 半成品  上下代码

dispatch_after(dispatch_time(DISPATCH_TIME_NOW,(int64_t)(0.51 * NSEC_PER_SEC)),dispatch_get_main_queue(), ^{

if (![self.presentedViewController isBeingDismissed]) {

[self dismissViewControllerAnimated:NO completion:nil];

}

});

其中 这个0.51 其实说是时间间隔 但是 我测试了下 如果 设置成了 0.01  测试了10此 每次还是会出现这个bug 如果0.99 测试了20次 没出现一次

个人认为 这数字 好像就是百分比的概率问题 欢天喜地 的把接口 扔给游戏那边了 说一下 我这边是客户端 做完要给游戏端接入下 测试下 能用不 我这边测试能用

可是 一到游戏那边  这个方法  怎么弄都不行  有的时候是 第一次运行可以 第二次运行不行 第三次运行又可以了 ,反正就是找不到规律 所以这个方法 对我还是不行

第二个 解决方法  试了下  完全可以用了  上下代码

-(void)viewDidAppear:(BOOL)animated

{

[super viewDidAppear:animated];

[self forcedUpdateVersionSelf];

}

没错 把你要dismiss 的方法 写到 -(void)viewDidAppear:(BOOL)animated  中即可  我 原先是写到

-(void)viewDidLoad中了 所以 总出这个错误

这个错误翻译下 :你的视图控制器还在程序中, 你却试图清除你的ViewController。

理解的意思 是 应该是 你的视图还没有完全加载成功呢 你却要消除视图  这样计算机 就可能有时候 搞不清 你到底 想干什么  到底是加载 还是清除

Warning: Attempt to dismiss from view controller <UIViewController: 0x17d71c10> while a presentation or dismiss is in progress!的更多相关文章

  1. Warning: Attempt to present on whose view is not in the window hierarchy!

    当我想从一个VC跳转到另一个VC的时候,一般会用 - (void)presentViewController:(UIViewController *)viewControllerToPresent a ...

  2. Warning: Attempt to present A on B whose view is not in the window hierarchy!

    昨天写豆瓣发广播Demo的时候,为了写Demo的简单,就使用了Storyboard,结果执行视图跳转时遇到了这个问题: Warning: Attempt to present <UINaviga ...

  3. 错误:Warning: Attempt to present <UIAlertController: 0x7fd192806e20> on <ViewController: 0x7fd1928048d0> whose view is not in the window hierarchy!

    系统:mac OS  10.12 (16A323) Xcod:8.3.3 错误:Warning: Attempt to present <UIAlertController: 0x7fd1928 ...

  4. XCode warning:“View Controller” is unreachable because it has no entry points

    Unsupported Configuration: “View Controller” is unreachable because it has no entry points, and no i ...

  5. 【IOS笔记】View Controller Basics

    View Controller Basics   视图控制器基础 Apps running on iOS–based devices have a limited amount of screen s ...

  6. View Controller Transition:京东加购物车效果

    冬天已经过去了,阳光越来越暖洋洋的了.还记得上学的时候,老师总说"春天是播种的季节",而我还没在朋友圈许下什么愿望.一年了,不敢想象回首还能看到点什么,所以勇往直前.当被俗世所扰, ...

  7. View Controller Programming Guide for iOS---(五)---Resource Management in View Controllers

    Resource Management in View Controllers View controllers are an essential part of managing your app’ ...

  8. View Controller Programming Guide for iOS---(四)---Creating Custom Content View Controllers

    Creating Custom Content View Controllers 创建自定义内容视图控制器 Custom content view controllers are the heart ...

  9. View Controller Programming Guide for iOS---(二)---View Controller Basics

    View Controller Basics Apps running on iOS–based devices have a limited amount of screen space for d ...

随机推荐

  1. Codeforces Round #231 (Div. 2) E.Lightbulb for Minister

    题意:有n个点,问在一个m边形内哪个点与这n个点的距离平方和最小 题解:(ai-a0)^2=ai*ai+a0*a0-a*ai*a0 合起来就是a1*a1+...+an*an+n*a0*a0-2*a0* ...

  2. 为PetaPoco添加实体模板

    Brad为我们提供了T4模板,因为公司一直在使用CodeSmith,故为其写了一个CodeSmith的模板,代码如下: <%-- Name:EntityTemplates Author: Des ...

  3. 【Redis】Redis的基本安装及使用

    在Linux上安装Redis Redis的安装很简单.基本上是下载.解压.运行安装脚本.我用的Redis版本是3.2.1. [nicchagil@localhost app]$ wget -q htt ...

  4. Dialog , ProgressDialog , PopWindow 区别

    本质区别: Dialog:非阻塞对话框,弹出对话框时时,后台还可以做事情,点击背景时,对话框消失 ProgressDialog:带有圆形进度或者条形进度的对话框,一般结合handler使用.任务完成后 ...

  5. (转) C/C++中const关键字详解

    文章转自  http://www.cnblogs.com/yc_sunniwell/archive/2010/07/14/1777416.html 为什么使用const?采用符号常量写出的代码更容易维 ...

  6. XAF How to: 实现一个WCF Application Server 并配置它的客户端应用

    本主题描述了如何实现一个 WCF 中间层应用程序服务器及如何配置 XAF客户端连接到此服务器. 注意 本主题演示可以由解决方案向导自动生成的代码.执行操作时,如果你想要在现有的 XAF 解决方案中实现 ...

  7. 深入浅出设计模式——代理模式(Proxy Pattern)

    模式动机在某些情况下,一个客户不想或者不能直接引用一个对象,此时可以通过一个称之为“代理”的第三者来实现间接引用.代理对象可以在客户端和目标对象之间起到中介的作用,并且可以通过代理对象去掉客户不能看到 ...

  8. 访问google.com

    ping www.google.com 得到的IP来访问

  9. Jquery报错:Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || e.handler).apply is not a function

    页面中出现了Jquery报错:Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || ...

  10. PHP 小方法之 仿百度蜘蛛采集

    if(!function_exists('_GetContent')){ function _GetContent( $url ){ $ch = curl_init(); $ip = '220.181 ...