【问题标题】:iOS9 dismissing keyboard causes crashiOS9关闭键盘导致崩溃
【发布时间】:2015-12-09 18:10:36
【问题描述】:

当我尝试在 iOS 9.1 模拟器上运行我的应用时,我遇到了崩溃

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UIInputWindowController: 0x7ff82b036e00>)

主函数发生崩溃。

当我尝试关闭键盘时发生崩溃

[self.username resignFirstResponder];

也当你self.view.userInteractionEnabled = false;

我已经阅读了 View appear with modal view animation instead of show (push) animation 的类似问题 - 但我只有 1 个根导航控制器

有什么想法吗?

iOS 9 唯一的错误

【问题讨论】:

  • 我已经启用了 Zombie,在这里我得到了 [UIInputWindowController parentViewController]: message sent to deallocated instance 0x7f9d29817a00

标签: crash keyboard ios9


【解决方案1】:

问题在于 UIViewController 类别

dealloc 方法被重写以清理通知回调。

它导致了 iOS 9 的崩溃。可能是因为 [super dealloc] 没有被调用(由于 ARC 限制)

解决方案 - 从类别中删除 dealloc 方法到 UIViewController 子类

【讨论】:

    猜你喜欢
    • 2016-02-06
    • 1970-01-01
    • 1970-01-01
    • 2015-12-13
    • 1970-01-01
    • 2013-04-08
    • 2021-05-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多