-[UIKeyboardLayoutStar release]: message sent to deallocated instance

时间:2021-12-18 08:14:32

网上大家都说是因为替换了系统的objextAtIndex方法,但是为了减少应用崩溃的可能,是要进行Hook的,所以不想取消Hook.

解决办法,关掉键盘进入后台。

- (void)applicationWillResignActive:(UIApplication *)application {

    [[UIApplication sharedApplication].keyWindow endEditing:YES];

}