gpt4 book ai didi

推送 "animated"设置为 "YES"的 View Controller 时,iOS 应用程序崩溃,但在 "animated"设置为 "NO"时工作正常

转载 作者:行者123 更新时间:2023-11-29 11:21:01 26 4
gpt4 key购买 nike

好吧,现在这对我来说真是令人难以置信,我真的无法理解它......我用谷歌搜索了它,但仍然一无所获。

我设置了一个推送 Root View Controller 的 UINavigationController。 Root View Controller 然后在按下 UIButton 时推送一个新的 View Controller (实际上它是一个 TableViewController),这就是事情变得奇怪的地方。

仅当我将“动画”设置为"is"时应用程序才会崩溃。

[[self navigationController] pushViewController:listView animated:YES];

如果我更改此设置并将“animated”设置为“NO”,应用程序将继续正常运行并运行良好...我将“animated”设置回“YES”,它再次崩溃。

最终,如果我能保留动画我会喜欢它,毕竟它是 iOS 最美丽的东西之一,但在目前的情况下,我无法为我的生活弄清楚发生了什么.

请帮我弄清楚这里可能出了什么问题。

最佳答案

当动画打开时,Core Animation 从 Root View Controller 和新 View Controller 访问 CALayer 对象,即 View 的绘制部分。当动画关闭时,Core Animation 不需要 Root View Controller 的 CALayer 对象。也许您在 Root View 中释放了一些 View ,并且它支持 CALayer 对象的速度太快了。

关于推送 "animated"设置为 "YES"的 View Controller 时,iOS 应用程序崩溃,但在 "animated"设置为 "NO"时工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7147724/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com