Closed lauran404 closed 2 years ago
Bug 表现 在iOS10系统运行, webView加载网页后, 点击网页中的输入框会发生闪退. 通过断点调试发现是框架如下方法导致闪退:
UISearchBar +load 方法中重写UINavigationButton setEnabled, 注释掉以下框架方法能恢复正常: OverrideImplementation(NSClassFromString(@"UINavigationButton"), @selector(setEnabled:), ^id(__unsafe_unretained Class originClass, SEL originCMD, IMP (^originalIMPProvider)(void)) { return ^(UIButton *selfObject, BOOL firstArgv) {
UISearchBar *searchBar = nil; if (@available(iOS 13.0, *)) { searchBar = (UISearchBar *)selfObject.superview.superview.superview; } else { searchBar = (UISearchBar *)selfObject.superview.superview; } if ([searchBar isKindOfClass:UISearchBar.class] && searchBar.qmui_alwaysEnableCancelButton && !searchBar.qmui_searchController) { firstArgv = YES; } // call super void (*originSelectorIMP)(id, SEL, BOOL); originSelectorIMP = (void (*)(id, SEL, BOOL))originalIMPProvider(); originSelectorIMP(selfObject, originCMD, firstArgv); }; });
如何重现
其他信息
crash输出信息: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIToolbar qmui_alwaysEnableCancelButton]: unrecognized selector sent to instance 0x159918ed0'
Bug 表现 在iOS10系统运行, webView加载网页后, 点击网页中的输入框会发生闪退. 通过断点调试发现是框架如下方法导致闪退:
UISearchBar +load 方法中重写UINavigationButton setEnabled, 注释掉以下框架方法能恢复正常: OverrideImplementation(NSClassFromString(@"UINavigationButton"), @selector(setEnabled:), ^id(__unsafe_unretained Class originClass, SEL originCMD, IMP (^originalIMPProvider)(void)) { return ^(UIButton *selfObject, BOOL firstArgv) {
如何重现
其他信息
crash输出信息: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIToolbar qmui_alwaysEnableCancelButton]: unrecognized selector sent to instance 0x159918ed0'