简体   繁体   English

按下电源按钮时Webview引发错误

[英]Webview throws error when press power button

In my application view I have web view. 在我的应用程序视图中,我具有Web视图。 Now if the webview is loading the data and user press power button of the iphone to lock the device then some time the app halts. 现在,如果Web视图正在加载数据,并且用户按下iphone的电源按钮以锁定设备,则该应用会暂停。 When user unlock the device then app throws this error message. 当用户解锁设备时,应用会引发此错误消息。

void SendDelegateMessage(NSInvocation*): delegate (webView:resource:willSendRequest:redirectResponse:fromDataSource:)
 failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode 

so will you please tell me how this problem can be solved. 所以请您告诉我如何解决这个问题。 This problem happens often. 这个问题经常发生。

check if the UIApplicationWillResignActiveNotification is fired (which it does when the user locks the iphone) then just stop loading the webview... 检查是否触发了UIApplicationWillResignActiveNotification (在用户锁定iPhone时执行),然后停止加载Webview ...

[webView stopLoading];

let me know if this works... 让我知道这个是否奏效...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM