iphone,uiwebview加载本地html文件

NSString *resourcePath = [[NSBundle mainBundle] resourcePath];   
NSString *filePath = [resourcePath stringByAppendingPathComponent:@"first.html"];   

NSString *htmlString = [[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];      
[webView loadHTMLString: htmlString baseURL: [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];

你可能感兴趣的:(html)