iOS9 dismissing keyboard causes crash

2019-05-21 08:10发布

When i try to run my app at iOS 9.1 simulator i have a crash

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

Crash happens in main function.

Crash happens when i try to dismiss the keyboard with

[self.username resignFirstResponder];

Also when you self.view.userInteractionEnabled = false;

I've read View appear with modal view animation instead of show (push) animation with similar issue - but i have only 1 root navigation controller

Any ideas?

iOS 9 only bug

1条回答
来,给爷笑一个
2楼-- · 2019-05-21 08:30

Issue was with UIViewController category

dealloc method was overridden to clean up notification callbacks.

And it caused a crash on iOS 9. Probably due to the fact [super dealloc] wasn't called (due to ARC restrictions)

Solution - remove dealloc method from category to the UIViewController subclasses

查看更多
登录 后发表回答