user1437183
user1437183

Reputation: 1

NSURLErrorDomain error -999 - links failing in iOS

I have an iOS app running a bunch of internal HTML pages all coming out from a HTML main menu

I'm using Hype to construct the pages.

The menu is not reliable, sometimes mouse clicks are recognised, sometimes not

When successful and the page loads - My xcode output console is giving me the following message when the sub page loads

Failed to load webpage with error: The operation couldn’t be completed. (NSURLErrorDomain error -999.)

The pages in question each feature 2 iFrames ( one for additional content, 1 for an audio player)

Taking out the iFrames cures it but they are kinda core to the App

I've been checking around and have seen that some folk suggest inserting this

if ([error code] != NSURLErrorCancelled) {
//show error alert, etc.
}

into my project but as a noob with xcode, I'm unsure of where to place it

Thanks all - its appreciated

Upvotes: 0

Views: 2181

Answers (1)

motou
motou

Reputation: 736

Normally in MainViewController.m

- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error 
{
    NSLog(@"Error %i", error.code);
    if (error.code == NSURLErrorCancelled) { 
        return; // this is Error -999
    }
    return [super webView:theWebView didFailLoadWithError:error];
}

Upvotes: 1

Related Questions