dismissViewControllerAnimated crash at ios5(ios5 上的dismissViewControllerAnimated 崩溃)
问题描述
代码会因为循环引用而崩溃吗?
Does the code crash, because of a circular reference?
模态/子类:
我看到 self.tabDelegate 是 MenuController 实例,并且在该代码上想要关闭并释放 TabsController.
As I see the self.tabDelegate is the MenuController instance and on that code want do dismiss and deallocate the TabsController.
虽然在 [self.tabDelegate myViewDismissed] 之后不再是代码;但是如果它不能执行,因为它被释放了,也许程序集 Ret 或者什么指令不能执行?返回语句.
Although it isn't any more code after [self.tabDelegate myViewDismissed]; but if it would be than couldn't execute, because it is deallocated, maybe the assembly Ret or what instruction can't be executed? the return statement.
我会尝试分离委托还是有更好的解决方案?
I will try to separate the delegate or any better solution?
崩溃是典型的:EXC_BAD_ACCESS(code=1,address=090)大会看起来像这样:ldr r1, [r4, r0]
The crash is the typical one: EXC_BAD_ACCESS(code=1,address=090) the Assembly looks like this: ldr r1, [r4, r0]
修改了一点代码,因为在模拟器 4.3 中不会崩溃,但在 5.0 时会崩溃,现在这里是当前代码:
changed a bit the code, because in simulator 4.3 doesn't crash, but at 5.0 it is, now here is the current code:
Edit3 截图:
UIWindowController 转换:fromViewController:toViewController:didEndSeelctor 行崩溃,原因是:没有 parentViewController:https://devforums.apple.com/message/451045伙计们在这里找到了解决方案:https://github.com/ideashower/ShareKit/issues/254 但在保密协议下
UIWindowController transition:fromViewController:toViewController:didEndSeelctor line is crashing, due to: no parentViewController: https://devforums.apple.com/message/451045 Guys here found a solution, : https://github.com/ideashower/ShareKit/issues/254 but in under NDA
编辑已解决以重写到适用于 ios 5.0+ 的 PushviewController完整链接:https://stackoverflow.com/a/7767767/529543
Edit solved to revrite to PushviewController for ios 5.0+ a heplfull link: https://stackoverflow.com/a/7767767/529543
}
然后弹出:
我已经解决了我的问题,在一个非常丑陋的模式下,但功能正常......还被告知放弃对 ios3 的支持 :) 我根本不喜欢运行时的 GUI 架构切换.
I have solved my problem, in a very ugly mode, but is functional...Also told to drop the support for ios3 :) I don't like the GUI architecture switch at runtime at all.
推荐答案
你的问题有点难理解,但我猜你有一个retain-cycle:
Your question is a little difficult to understand, but I gather you have a retain-cycle:
两个对象都没有被释放?
and neither object gets deallocated?
您的 tabDelegate 属性应为:
Your property for the tabDelegate should read:
这篇关于ios5 上的dismissViewControllerAnimated 崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!