昨天 调试程序 已经快要上线了 突然有个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. JavaEE程序员必读图书大推荐

    下面是我根据多年的阅读和实践经验,给您推荐的一些图书: 第一部分: Java语言篇 1 <Java编程规范> 星级: 适合对象:初级,中级 介绍:作者James Gosling(Java之 ...

  2. CSS 高级语法 ---- 继承和选择器的分组

    1. 选择器的分组 —————————————————————————   可以对选择器进行分组,被分组的选择器享用共同的声明.   h1,h2,h3,h4,h5,h6 { color: green; ...

  3. MySQL查询语句

    来源于网络... Sutdent表的定义 字段名 字段描述 数据类型 主键 外键 非空 唯一 自增 Id 学号 INT(10) 是 否 是 是 是 Name 姓名 VARCHAR(20) 否 否 是 ...

  4. Sublime Text的使用代码块安装的模块

    在众多的开发工具IDE当中.作者现在唯独深爱sublime text(以下简称st).以前做后台开发使用visual studio(以下简称vs),以及实行前后端分工也是配合后台使用vs.这里要讲述两 ...

  5. centos 服务开机启动设置

    建立服务文件以nginx 为例 vim /lib/systemd/system/nginx.service 在nginx.service 中插入一下内容 [Unit] Description=ngin ...

  6. Fact表的星型结构

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  7. intellij中编译报错: The packaging for this project did not assign a file to the build artifact

    原因是run configuration -> maven -> preject name -> Parameters -> command line中是install:ins ...

  8. c-free

  9. openwrt 的依赖找不到问题

    Openwrt报告库找不到Package * is missing dependencies for the following libraries: libc.so.6 或其他先检查系统里面有没有这 ...

  10. 最短路径——Floyd算法

    如何求一张图中任意两顶点之间的最短路径长度,这里写一种最简单的算法——Floyd算法: #include<stdio.h> #define inf 9999 int main() { ][ ...