It might be simple question but I haven't found the clear answer. I am loading a simple webview as following.. However, when signal is not good, it's just stuck there forever..
Could you please advise me the best way to set time out for this?
[TestViewController.webView loadRequest:requestObject]
Set the timeout for the NSURLRequest
NSURLRequest *requestObject = [NSURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageAllowed timeoutInterval:10]; // timeoutInterval is in seconds
[TestViewController.webView loadRequest:requestObject]
Also see this SO post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With