简体   繁体   English

无法加载网页 - 错误(NSURLErrorDomain错误-999)

[英]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. 我有Phonegap项目,我需要打开iframe,我试图用JavaScript打开iframe。 I get the error in iOS 我在iOS中收到错误

Error: The operation couldn't be completed. 错误:无法完成操作。 (NSURLErrorDomain error -999) (NSURLErrorDomain错误-999)

Anyone here knows about this error or how to open iframe in Phonegap iOS. 这里的任何人都知道这个错误或如何在Phonegap iOS中打开iframe。

NSURLErrorCancelled Returned when an asynchronous load is canceled. NSURLErrorCancelled取消异步加载时返回。 A Web Kit framework delegate will receive this error when it performs a cancel operation on a loading resource. Web Kit框架委托在对加载资源执行取消操作时将收到此错误。 Note that an NSURLConnection or NSURLDownload delegate will not receive this error if the download is canceled. 请注意,如果取消下载,NSURLConnection或NSURLDownload委托将不会收到此错误。 Available in OS X v10.2 and later. 适用于OS X v10.2及更高版本。 Declared in NSURLError.h. 在NSURLError.h中声明。

NSURLErrorDomain error -999 is triggered when asynchronous network call is cancelled. 取消异步网络呼叫时会触发NSURLErrorDomain错误-999。

NSURLErrorDomain error -999 == NSURLErrorCancelled NSURLErrorDomain错误-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. 如果您使用UIWebViewDelegate捕获错误,则可以尝试重新加载内容,直到它成功加载。 Just insert the requestWithURL a second time in the 只需在第二次插入requestWithURL

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

delegate. 代表。 This will cycle until the page loads successfully. 这将循环直到页面成功加载。 This is especially necessary with Facebook and Twitter. 这对于Facebook和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. 如果您不想遇到死锁,可以在对象中计算一个int属性,在尝试5次后绕过请求。

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

相关问题 ionic无法加载网页,并显示以下错误:操作无法完成。 (NSURLErrorDomain错误-999。) - ionic failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.) 加载失败,错误为 Error Domain=NSURLErrorDomain Code=-999“已取消” - load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" 加载网页失败,出现错误:操作无法完成。 NSURLErrorDomain错误-999将Ionic应用程序部署到iOS设备 - Failed to load webpage with error: The operation couldn’t be completed. NSURLErrorDomain error -999 deploying Ionic app to iOS device (NSURLErrorDomain错误-999。) - (NSURLErrorDomain error -999.) Swift - AVPlayer 加载失败,错误为 Error Domain=NSURLErrorDomain Code=-999“已取消” - Swift - AVPlayer load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" 我们用NSURLErrorDomain错误-999阻止错误 - weblock error with NSURLErrorDomain error -999 使用UIWebView的NSURLErrorDomain错误-999 - NSURLErrorDomain error -999 using UIWebView NSURLErrorDomain错误-999 IOS7 - NSURLErrorDomain error -999 IOS7 Xamarin iOS中的NSURLErrorDomain错误-999 - NSURLErrorDomain error -999 in Xamarin iOS PhoneGap + iOS:NSURLErrorDomain错误-999 - PhoneGap + iOS: NSURLErrorDomain error -999
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM