zoukankan      html  css  js  c++  java
  • 【纠错】视图跳转的几个常见警告以及解决方案

    最近智商一不小心就拙急了一下。老范晕,遇到几个细节问题硬是憋了我半天。总结一下:

    我使用的故事版 

    跳转的方式是连接两个需要跳转的ViewController,然后根据id使用[self performSegueWithIdentifier:@"*id" sender:nil];进行跳转

    (故事版的话,我是比较喜欢这种方式,虽然会多谢几行代码,但是灵活性提升很多。)

    跳转倒是没问题,但是会出现警告。当时真是不明觉厉。

    1、Warning: Attempt to present *viewController  on *viewController  while a presentation is in progress!

    2、Warning: Attempt to dismiss from view controller *viewController while a presentation or dismiss is in progress!
    然后自己鼓捣了一上午,把第一个警告鼓捣成了

    Warning: Attempt to present *viewController on *viewController whose view is not in the window hierarchy!

    这尼玛坑爹!

    最后发现原因是自己想

    跳转的方式是连接两个需要跳转的ViewController,然后根据id使用[self performSegueWithIdentifier:@"*id" sender:nil];进行跳转

    结果,因为后来多增加了一个跳转选项,而自己在连线的时候一时脑昏直接连了按钮。

    也就是说,同时进行了多次present,导致了警告。

    检讨自己的同时,与大家共勉。

  • 相关阅读:
    codeforces 1251 F. Red-White Fence
    NTT 模板
    快速傅里叶变换模板
    codeforces 1251E (贪心)
    平衡树
    lucas定理
    P3709 大爷的字符串题 (莫队)
    洛谷 P3258 [JLOI2014]松鼠的新家 (树链剖分或树上差分)
    算法-图(5)深度优先遍历图
    计算机网络-链路层(3)交换局域网
  • 原文地址:https://www.cnblogs.com/anjohnlv/p/3396304.html
Copyright © 2011-2022 走看看