Q:

How to load local HTML file in UIWebView?

I am newbie to Objective-C.I want to know how to load the local html file(say index.html) into UIWebView,i can able to load the url like this,
  -(void)viewWillAppear:(BOOL)animated
    {
        NSLog(@"willAppear");

        UIWebView *myWebView=[[UIWebView alloc]initWithFrame:CGRectMake(20, 20, 400, 400)];

        NSURL *url = [[NSURL alloc] initWithString:@"http://www.google.co.in/"];

        [myWebView loadRequest:[NSURLRequest requestWithURL:url]];
        myWebView.scalesPageToFit = YES;
        [self.view addSubview:myWebView];
    }

I want to load the local html file instead of loading url.How do i do that?.
and also i want to call the delegate method 
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request

navigationType:(UIWebViewNavigationType)navigationType,which is not being called.Any guidance is neatly appreciated.Thanks.

A:

First of all,please go through the apple document before searching in google.I suggest you to go through the basic objective c programming concept. 
In reference to UIWebView,i would like to tell you how to load the local html.
UIWebView *myWebView=[[UIWebView alloc]initWithFrame:CGRectMake(20, 20, 400, 400)];
NSString *indexPath = [NSBundle pathForResource:@"index" ofType:@"html" inDirectory:nil];
[myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:indexPath]]];
[self.view addSubview:myWebView];

To call any delegate methods first implement the  UIWebViewDelegate protocol in your class..i.e. in your interface's declaration like below…
@interface YourViewController : UIViewController<UIWebViewDelegate>

Then set your webview delegate to your class..ie.,next after you initialize your web view.
myWebView.delegate = self; 

Hope it works…Happy Coding :-)

