UIWebView: decidePolicyForNavigationAction?

强颜欢笑 提交于 2019-12-24 13:42:57

问题


I'm using a UIWebView in my app, and everything works fine in iOS5 and 6. But on iOS7 the UIWebView can't load the page requested (an html from internet) and start an infinite loop with this error every 10 secs:

void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode

The webview loadrequest is located in viewDidAppear.

I found no documentation for this bug for iOS. The method decidePolicyForNavigationAction seems to be used only in WebKit for MacOS.. and not for iOS.

Same problem both on device and on simulator. I saw similar topics on stackoverflow, but noone report a working solution :/

Thanks for your help.


回答1:


Try to download new xCode version 5.0.1 This issue is fixed in version 5.0.1 Also, clean all the builds from the path ~/Library/Developer/Xcode/DerivedData/~ Build after clean. Everything works fine. Let me know if the issue still persist.




回答2:


Problem solved:

My problem was related to a library linked in the project: pspdfkit v2.x on iOS7.

Initializing the uiwebview before pspdfkit (even without presenting it) solved my problem.



来源:https://stackoverflow.com/questions/19497539/uiwebview-decidepolicyfornavigationaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!