DEV Community

Server Broad
Server Broad

Posted on

Answer: Error Handling Page of PhoneGap in IOS

  1. I created error.html in www folder under staging folder in Xcode.
  2. I make a change in config.xml under staging folder in Xcode as follow

<preference name="errorURL" value="error.html" />

in MainViewController.m : i created didFailLoadWithError method (see example below :

-(void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error 
{
[theWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"error" ofType:@"html"

Top comments (0)