[iOS] iOS9 收起键盘崩溃

Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior (<UIInputWindowController: >)
这个闪退之后 要么停到main,要么停到sendEvent,反正就是让你无从下手,其实这个问题超级简单而且复现必崩溃。
问题就是工程中有UIViewController的分类(Category),然后你在分类中实现了dealloc方法,ARC不支持这种管理,就崩溃了。你试试随便写个demo,只要在工程新建一个UIViewController的Category并写一个空的dealloc方法,就能完美复现。

解决方法就是:

Category中删除dealloc方法,就没问题了。你如果需要处理一些和释放相关的,放到其他地方,动动小脑袋你肯定能想到不用dealloc也能实现的方法。

参考:https://stackoverflow.com/questions/32552986/ios9-dismissing-keyboard-causes-crash

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容