UIWebView webCore在iOS7.1中崩溃(例如:www.latimes.com) [英] UIWebView webCore crashes in iOS7.1 (example: www.latimes.com)
问题描述
在打开洛杉矶时报(www.latimes.com)时,我在iOS应用程序中看到了崩溃。崩溃发生在WebCore的某个地方,我不知道在哪里。使用Zombie或leaks进行性能分析不会返回任何EXE_BAD_ADDRESS错误。
I have being seeing crashes in my iOS app, when opening LA Times (www.latimes.com). The crash happens in WebCore somewhere and I have no clue where. Profiling with both "Zombie" or "leaks" do not return anything for this "EXE_BAD_ADDRESS" error.
我还检查了一个小的,裸露的UIWebView应用程序,我可以重现效果。
I also checked with a small, bare UIWebView app and I could reproduce the effects.
现在,我看到这种情况只发生在洛杉矶时代,但我不确定是否还有其他网站。
Right now, I see this happening only with LA times, but I am not sure if there are other sites as well.
有人可以查看并指导我可能出现此次崩溃的错误/来源吗?
Can someone check on and guide me in what could be the possible error/source for this crash?
编辑:我添加了一个小型UIWebView项目,以
github < a>
I have added a small UIWebView project demonstrating this bug at github
编辑2:该应用程序(包括github上的演示版)在iOS 7.0上完美运行,但在iOS 7.1中崩溃了。 。似乎是iOS 7.1最近的一个错误。我已经向Apple发布了一个错误报告,并会不断更新。
提前致谢,
Nikhil
EDIT 2: The app (include the demo at github) works perfectly fine on iOS 7.0, but crashes in iOS 7.1 ... seems a recent bug with iOS 7.1. I have issued a bug report to Apple and will keep updated. Thanks in advance, Nikhil
推荐答案
我碰巧遇到了同样的问题iOS中的应用程序仅限7.0。
I happened to bump into that same issue with one of my apps in iOS>7.0 only.
这似乎是一个同步问题,可以通过仅从主线程创建webview来解决。
It seems to be a sync issue which can be fixed by creating the webview from the main thread only.
作为修复,我只是在 dispatch_sync(dispatch_get_main_queue()中包装了我的
UIWebView
创建,^ {...});
As a fix I just wrapped my UIWebView
creation in a dispatch_sync(dispatch_get_main_queue(), ^{ ... });
它解决了这个问题。
当然如果你的代码在主线程上运行,你不应该这样包装;)
And it solved the problem. Of course if your code is running on the main thread you shouldn't wrap it this way ;)
这篇关于UIWebView webCore在iOS7.1中崩溃(例如:www.latimes.com)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!