NSURL ERROR domain Error code = 999

Please advise.

We use this method, and unable to pass the form , and stuck at the error code Domain=NSURLErrorDomain Code=-999 "(null)"

NSURL* URL = [[NSBundle mainBundle] URLForResource:@"cameraProxy.html" withExtension:nil subdirectory:@"www" ];

            [theWebView loadRequest:[NSURLRequest requestWithURL:URL]];

2022-08-05 17:51:46.290824+0900 SMSC[35139:1191314] ERROR : Error Domain=NSURLErrorDomain Code=-999 "(null)"

2022-08-05 17:51:46.295358+0900 SMSC[35139:1191314] MainViewController url = (null) 2022-08-05 17:51:46.295900+0900 SMSC[35139:1191314] 35139: CFNetwork internal error (0xc01a:/Library/Caches/com.apple.xbs/Sources/CFNetwork_Sim/CFNetwork-1327.0.4/Protocol/HTTPProtocol.cpp:274)

Error -999 is NSURLErrorCancelled, which means that something cancelled the load. It’s hard to say what that might be based on the info you’ve posted so far. Let’s start with some basic stuff:

  • What platform are you targeting?

  • Which web view are you using? WKWebView? Or one of the legacy web views?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you very much for your support, Really appreciated !!

Platform - Cordova ver 11 WebView - UIWebView ISO 15 is the current test. ISO 14 and 13 seem to be working fine.

Ideally, I like to use UIWebView (the existing one before rewriting/reworking from UIWebView to WkWebView.)..

I'm not sure this is due to URLForResource and UIWebView, it seems that's where it is causing the issue.  I tested the sample code attached working fine with pathforResource seems the URL opened fine, which is used for WkWebView, URLForResource is not working. FYI, "I" and "send and "mail" to you, myEmail = "eskimo" + "1" + "@" + "apple.com"

Is this possible might a bug was fixed in the IOS? https://github.com/apache/cordova-ios/issues/612

I’m sorry but I can’t help you with third-party tools and libraries. In this specific case, there are many layers of stuff between you, writing code in Cordova, and the source of that error in CFNetwork, and any one of those layers could be triggering your issue. You have a couple of choices here:

  • You can continue working at the Cordova layer, at which point I recommend that you seek help from folks with relevant experience by escalating via its support channel.

  • You work to isolate this problem so that it only uses Apple tools and libraries, at which point I’ll be able to take another look.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

NSURL ERROR domain Error code = 999
 
 
Q