简体   繁体   中英

Failed to load webpage - error (NSURLErrorDomain error -999)

I have Phonegap project where i have requirement for open iframe, where I am trying to open an iframe with JavaScript. I get the error in iOS

Error: The operation couldn't be completed. (NSURLErrorDomain error -999)

Anyone here knows about this error or how to open iframe in Phonegap iOS.

NSURLErrorCancelled Returned when an asynchronous load is canceled. A Web Kit framework delegate will receive this error when it performs a cancel operation on a loading resource. Note that an NSURLConnection or NSURLDownload delegate will not receive this error if the download is canceled. Available in OS X v10.2 and later. Declared in NSURLError.h.

NSURLErrorDomain error -999 is triggered when asynchronous network call is cancelled.

NSURLErrorDomain error -999 == NSURLErrorCancelled

Not sure how this would help, but hopefully it'll give you a new perspective.

All the other answers are true, but what to do then?

If you catch the error with the UIWebViewDelegate, you can try reloading the content until it loaded successfully. Just insert the requestWithURL a second time in the

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error

delegate. This will cycle until the page loads successfully. This is especially necessary with Facebook and Twitter. If you don't want to run into a deadlock, you can count up an int property in your object that bypasses the request after trying 5 times.

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