错误分析:

           controller A present controller B ,前提是A的view要存在,如果不存在,就会报这个错。
 
解决方法: 
           将原来的present语句由 viewDidLoad方法中移到 viewDidAppear中,问题就可以解决。但是这样的话,画面会闪现一下parentViewController的view,这个问题目前不清楚怎么解决,有待高人指点。
并且viewDidAppear这个方法是每次都进入,和ViewDidLoad只进一次不同,所以无法达到我要的效果。
 
最终方案:
           摈弃presentModel方法,在viewDidLoad中添加如下语句:
              [self.view addSubview:controllerB.view];

[self addChildViewController:controllerB];

自己添加想要的动画,实现对presentModel方法的模仿。

Warning: Attempt to present on whose view is not in模态跳转问题的更多相关文章

  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 <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 ...

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

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

  4. Warning: Attempt to present * on * which is already presenting *

    Warning: Attempt to present (要被presented的控制器)  on (哪个控制器来presenting) which is already presenting (已经 ...

  5. swift一次 Attempt to present on whose view is not in the window hierarchy的解决方法

    做的是二维码扫描,扫描后识别为URL的话就跳转到webview 加载网页,用的是代理传值的方式.扫描到了 值传递到主页 扫描窗体退出,检测值是否是http://开头 是网页就跳转. 问题出在传值到主界 ...

  6. iOS8 iPad Warning: Attempt to present <UIImagePickerController:xxxx > on xxxx which is already presenting (null)

    解决方法: /* I think this is because in iOS 8, alert views and action sheets are actually presented view ...

  7. Attempt to present <vc> on <vc> which is already presenting <vc>/(null)

    在给 tableViewCell 添加长按手势弹出一个 popViewController 的时候,遇到的这个变态问题: Warning: Attempt to present <UINavig ...

  8. Attempt to present <TestViewController2: 0x7fd7f8d10f30> on <ViewController: 0x7fd7f8c054c0> whose view is not in the window hierarchy!

    当 storyboard里面的 按钮 即连接了 类文件里面的点击方法  又  连接了   storyboard里 另一个  控制器的  modal 就会出现类似Attempt to present & ...

  9. Warning: Attempt to dismiss from view controller <UIViewController: 0x17d71c10> while a presentation or dismiss is in progress!

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

随机推荐

  1. [HDU] 2094 产生冠军(拓扑排序+map)

    产生冠军 Time Limit : 1000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submissi ...

  2. java socket网络编程(多线程技术)

    Client.java import java.io.*; import java.net.*; import java.util.*; public class Client { public st ...

  3. HDU - 1702 ACboy needs your help again!(栈和队列)

    Description ACboy was kidnapped!! he miss his mother very much and is very scare now.You can't image ...

  4. hdu - 2586 How far away ?(最短路共同祖先问题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2586 最近公共祖先问题~~LAC离散算法 题目大意:一个村子里有n个房子,这n个房子用n-1条路连接起 ...

  5. Reverse complement DNA

    用法:python rev_comp.py input.fa out.fa 输入文件为 fasta 格式文件,若输入文件中序列的 header 有 '+' 或 '-' 号标记正负链,则带有 '+' 的 ...

  6. Android Studio ADB响应失败解决方法(2CTo.com)

    当启动Android Studio时,如果弹出 adb not responding. you can wait more,or kill "adb.exe" process ma ...

  7. nodejs实践-代码组织

    nodejs实践-代码组织 laiqun@msn.cn Contents 1. 代码组织 1. 代码组织 更新版本 npm install -g n n latest 项目文件组织 MVC 前后端代码 ...

  8. CSS样式覆盖规则

    有一下问题, 想让下面的border生效 ,#比. 优先级高, #navigator { height: 100%; width: 200; position: absolute; left: 0; ...

  9. JfreeCHart 异常:Chart image not found

    http://bbs.justep.com/thread-54775-1-1.html java.lang.IllegalArgumentException: Width (0) and height ...

  10. 设置div,td失去焦点

    $(downobj).attr({"tabindex":"0"});还需要设置css样式outline:none;