bang590 / JSPatch

JSPatch bridge Objective-C and Javascript using the Objective-C runtime. You can call any Objective-C class and method in JavaScript by just including a small engine. JSPatch is generally used to hotfix iOS App.
MIT License
11.36k stars 2.24k forks source link

加载补丁后 项目里在加载webView的时候会crash #305

Open lovewillover opened 8 years ago

lovewillover commented 8 years ago

加载补丁文件后,如果初始化WebView的时候回Crash。具体崩溃在init方法 self = [super initWithFrame:frame];请问怎么解决

lovewillover commented 8 years ago

具体堆栈信息如图。请求支援。ios8 基本必现 5b14ee2d-bb30-439d-ae02-e3b72e7ad555

补丁文件代码如下 require('UIAlertView'); defineClass('LimitBuyViewController', { viewDidLoad: function() { self.ORIGviewDidLoad(); self.alert(); }, alert: function() { var alert = UIAlertView.alloc().initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles("请注意", "第二个热补丁加载成功", null, "确定", null, null); alert.show(); }, });

lovewillover commented 8 years ago

@dopcn crash是在native的webView初始化。jspatch代码里没有关于webView的任何逻辑。并且startEngine前已经初始化过一个空的webView .我先尝试用performSelectorInOC 调试一下。感谢回复

Awhisper commented 8 years ago

我遇到的情况是 performSelectorInOC 使用了 还是偶现。。不过我一直是偶现 不是必现 iOS 9