简体   繁体   中英

Webview throws error when press power button

In my application view I have web view. 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. 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...

[webView stopLoading];

let me know if this works...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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