UIWebView loads with error code -1008 - ios

Just playing around the UIWebView, I found some very interesting case...
When I hit a site with some xls file (say www.econ.yale.edu/~shiller/data/ie_data.xls) and now visit any other site and go back to the previous visited xls file. this file loads with an error and
webView(_ webView: UIWebView,didFailLoadWithError error: NSError?)
gets called with following error "resource unavailable", here is the destription
Error Domain=NSURLErrorDomain Code=-1008 "resource unavailable" UserInfo={NSErrorFailingURLKey=x-apple-ql-id://02C2F712-77CE-4015-8237-31BB4B203221/x-apple-ql-magic/Sheet0.html, NSLocalizedDescription=resource unavailable, NSErrorFailingURLStringKey=x-apple-ql-id://02C2F712-77CE-4015-8237-31BB4B203221/x-apple-ql-magic/Sheet0.html}
So guys I really curious to know what is this error all about and what -1008 error code says.
Note: This happens only in case of xls file

Related

HLS Player gives error and not playing the URL

I tried to play a live streaming url using AVplayer, the url working fine in the web. the server guy told me that in the response content type is application/x-mpegURL and video/MP2T. but when ever I try to play that im getting error messages.
Error Domain=AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo={NSUnderlyingError=0x7fe6bcae2170 {Error Domain=CoreMediaErrorDomain Code=-12939 "byte range and no content length - error code is 200" UserInfo={NSDescription=byte range and no content length - error code is 200
ps: the player which i created is working fine with others urls
can you please tell me what i need to do?

What the name of the error domain for HTTP error codes?

I have some network code which behaves differently if an error is due to timeout, bad url, url not found etc, etc. which are all covered by NSURLErrorDomain.
However if I get a http error, such as http 406, then that's not in NSURLErrorDomain. The domain is "HTTP Error", but I don't want to use that as a hardcoded string, I want to use whatever its NSWhateverErrorDomain definition is, but after loads of searching I just can't find what that is anywhere.
Undocumented NSURLErrorDomain error codes (-1001, -1003 and -1004) using StoreKit
Reference:
https://developer.apple.com/reference/cfnetwork/cfnetworkerrors

schema validation error occuring on localserver but not on github - Swagger

I am getting a schema validation error when i host my SWAGGER.JSON file on my local server that runs the swagger.html.
But, when i put the file in
https://raw.githubusercontent.com/novastorm123/abapswaggerNW7.0/master/swagger_70.json
It works.
I don't get any console error in both cases.
I treid to disable the online validator error from swagger.
I used
validatorUrl : null
But it is not working and i am still getting the error at the bottom of the page.
On clicking of the error i am getting the message
{"schemaValidationMessages":[{"level":"error","message":"Can't read from file
/api/swagger.json"}]}
Whenever i am pasting my JSON in the online editor, it is accepting it as a valid JSON Input

Strange Behaviour while loading URL in Webview in IOS

It looks simple, but don't know what goes wrong. I am trying to load a basic URL in WebView, as shown below
WebsiteWebView.delegate=self;
NSURL* url = [NSURL URLWithString:#"http://firstclasspizzaoc.com/"];
[WebsiteWebView loadRequest:[NSURLRequest requestWithURL:url]];
while loading i am getting below error everytime..
Error : Error Domain=NSURLErrorDomain Code=-999 "The operation couldn’t be completed. (NSURLErrorDomain error -999.)" UserInfo=0xe036d20 {NSErrorFailingURLKey=http://firstclasspizzaoc.com/, NSErrorFailingURLStringKey=http://firstclasspizzaoc.com/}
2014-01-07 15:18:46.142 FirstClassPizza[1583:
Error : Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo=0xe0ef310 {NSErrorFailingURLStringKey=XXXXXXXX, NSErrorFailingURLKey=XXXXXXXX, NSLocalizedDescription=A server with the specified hostname could not be found., NSUnderlyingError=0xcbe9130 "A server with the specified hostname could not be found."}
At Browser it is loading perfectly..
Please suggest what went wrong in my code..
Any Valuable suggestions will be appreciated...
Thanks
It is due to Your Web URL http://firstclasspizzaoc.com/ can you use your url with
http://www.firstclasspizzaoc.com/
You can find your answer here :
How do I fix NSURLErrorDomain error -999 in iPhone 3.0 OS
This thread contained this description for this error: "This error may occur if an another request is made before the previous request of WebView is completed..."
I worked around this by ignoring this error and letting the webview continue to load.
if ([error code] != NSURLErrorCancelled) {
//show error alert, etc.
}

Error opening Modal view: "The URL can't be shown"

This is the error that appears in the console:
[WARNING] Modal webview error: Error Domain=WebKitErrorDomain Code=101
"The URL can’t be shown" UserInfo=0x8fee7e0
{NSErrorFailingURLKey=http%3A%2F%2Fimgur.com%2F59tSD.jpg,
NSErrorFailingURLStringKey=http%3A%2F%2Fimgur.com%2F59tSD.jpg,
NSLocalizedDescription=The URL can’t be shown}
I get the same error when loading a local file with:
forge.tabs.open('about.html');
In the former case it looks like you need to decode your url decodeURIComponent
In the later, you need to get the full path to the local file using forge.tools.getURL
This should work:
forge.tools.getURL('about.html', function(url) {
forge.tabs.open(url);
});

Resources