Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

UIWebView - didFailLoadWithError - How to get the error's code list

MarcoMarco Posts: 69Registered Users
edited July 2009 in iOS SDK Development
Is there a way to get the error's code list and what they mean when the UIWebView DidFailLoadWithError troughs an error?
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error

Thanks
Post edited by Marco on
Peace in Christ<br />
Marco Napoli<br />
<a href="http://www.ourlovingmother.org" target="_blank">http://www.ourlovingmother.org</a>;
·

Replies

  • RickMaddyRickMaddy Posts: 2,122New Users
    edited November 2008
    Go to the docs for NSError. Then scroll down to the docs for the 'userInfo' method. Just below that is a list of constants used for extracting info about the error. One of those should give you what you want.
    ·
  • MarcoMarco Posts: 69Registered Users
    edited November 2008
    I looked at the NSError document but I could not find what the NSURLErrorDomain error -999 means. I get this error sometimes using the UIWebView.

    error.localizedDescription gives below description:

    UIWebView error:
    Operation could not be completed.
    NSURLErrorDomain error -999
    Peace in Christ<br />
    Marco Napoli<br />
    <a href="http://www.ourlovingmother.org" target="_blank">http://www.ourlovingmother.org</a>;
    ·
  • RickMaddyRickMaddy Posts: 2,122New Users
    edited November 2008
    I misunderstood your question. I haven't seen that error before. Sorry.
    ·
  • Akshay ShahAkshay Shah Posts: 314Registered Users
    edited November 2008
    This error may occur if an another request is made before the previous request of WebView is completed...

    I had encountered this scenario...
    Havent worked around it much yet but still found out this to be the reason, in my case.
    If you think I did help you, you can always thank me by buying <br />
    <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=331475779&mt=8" target="_blank">iHoldMore</a> - A very nice and addictive game...<br />
    <br />
    Need a m
    ·
  • MarcoMarco Posts: 69Registered Users
    edited November 2008
    What you said makes sense. If you find a workaround please let us know...
    Peace in Christ<br />
    Marco Napoli<br />
    <a href="http://www.ourlovingmother.org" target="_blank">http://www.ourlovingmother.org</a>;
    ·
  • ichiichi Posts: 22Registered Users
    edited December 2008
    In my app, it's likely a user will change page before a page has finished loading, so I just did this...


    - (void)webView:(UIWebView *)wv didFailLoadWithError:(NSError *)error {
    if ([error code] != -999) {
    //show error alert, etc.
    }
    }

    i couldn't find anyway to make it not throw an error if the previous request hadn't finished loading.
    ·
  • jmhammondjmhammond Posts: 2New Users
    edited January 2009
    ichi wrote: »
    In my app, it's likely a user will change page before a page has finished loading, so I just did this...


    - (void)webView:(UIWebView *)wv didFailLoadWithError:(NSError *)error {
    if ([error code] != -999) {
    //show error alert, etc.
    }
    }

    i couldn't find anyway to make it not throw an error if the previous request hadn't finished loading.


    This is exactly the fix that I had to use. It's hilarious that someone else did it, but sad that we have to code around the error -999...
    ·
  • markwwmarkww Posts: 179Registered Users
    edited February 2009
    Wow I am in the same -999 boat now:
    if ([error code] != -999) {
    }
    

    I am only getting that error if I try to visit a PayPal site using a UIWebView, otherwise I haven't had any problems with UIWebView.

    So this paypal site must be making the two requests before the first has completed?:

    "This error may occur if an another request is made before the previous request of WebView is completed..."
    ·
  • IchigoKygerIchigoKyger Posts: 1New Users
    edited July 2009
    Yea now I'm getting this error.... Can't figure it out... =/
    ·
Sign In or Register to comment.