每当到 618、双 11 这样大促的时候,搜索作为整个 App 的核心功能,不仅担当着流量入口,还承载着用户感知到这个产品在导购场景中的服务与体验,所以保障搜索以便更好的助力 618 大卖。
搜狗输入框双击调起键盘 crash
监控平台检测到大量的 crash,现象都为在极短的时间间隔内键盘响应问题
App | 是否崩溃 | 频率 |
---|---|---|
京东 | 是 | 高 |
京东万商 | 是 | 高 |
七鲜 | 是 | 高 |
淘宝 | 否 | |
支付宝 | 是 | 中 |
百度 | 是 | 中 |
百度地图 | 否 | |
美团 | 否 | |
盒马 | 否 | |
1688 | 否 | |
哔哩哔哩 | 否 | |
抖音 | 是 | 低 |
_wantsForwardingFromResponder:toNextResponder:withEvent
static BOOL (*originalImpl)(id, SEL, UIResponder*, UIResponder*, UIEvent* ) = nil;
- (BOOL)_wantsForwardingFromResponder:(UIResponder *)arg1 toNextResponder:(UIResponder *)arg2 withEvent:(UIEvent *)arg3 {
NSString* responderClassName = NSStringFromClass([arg2 class]);
if ([responderClassName isEqualToString:@"_UIRemoteInputViewController"]) {
bool isDeallocating = false;
// isDeallocating = _objc_rootIsDeallocating(arg2);
// Use 'performSelector' when u are develop a App-Store App.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
SEL sel = NSSelectorFromString(@"_isDeallocating");
isDeallocating = [arg2 respondsToSelector:sel] && [arg2 performSelector:sel];
#pragma clang diagnostic pop
if (isDeallocating) {
NSLog(@"BingGo a deallocating object ...");
return true;
}
}
BOOL retVal = FALSE;
if (originalImpl == nil) {
IMP impl = [ObjcSeeker seekInstanceNextOirignalImpl:self selector:_cmd];
originalImpl = (BOOL (*)(id, SEL, UIResponder*, UIResponder*, UIEvent* ))impl;
}
if (originalImpl != nil) {
retVal = originalImpl(self, _cmd, arg1, arg2, arg3);
}
return retVal;
}
https://github.com/SnowGirls/Objc-Deallocating
作者:京东零售 涂世展
来源:京东云开发者社区