iphone, UIWebView, Could it load a local file? Yes, It can do

iphone, UIWebView, Could it load a local file? Yes, It can do

    Can UIWebView can load and display a HTML from a local file at iPhone?
    Yes, It can working in my test case.

    test case 1, loading a resroutce file. failed


    - (void)viewDidLoad {

    NSString *pdfPath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
    NSURL *url = [NSURL URLWithString:pdfPath];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [myWebView loadRequest:urlRequest];

    }

    test case 2, loading a recource file. Working

    NSString *pdfPath2 = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
    NSURL *pdfURL = [NSURL fileURLWithPath:pdfPath2];
    NSURLRequest *URLReq = [NSURLRequest requestWithURL:pdfURL];
    [myWebView loadRequest:URLReq];