iOS9解除键盘导致崩溃

时间:2015-09-13 18:19:32

标签: crash keyboard ios9

当我尝试在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 - 但我只有一个根导航控制器

有什么想法吗?

iOS 9唯一的错误

1 个答案:

答案 0 :(得分:4)

问题在于UIViewController类别

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

它在iOS 9上造成了崩溃。可能是因为[super dealloc]未被调用(由于ARC限制)

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