我怎么才能在下面的代码中加载一个本地html文件保存到工程中,而不是加载一个网页?

- (void)loadAboutHTML {
UIWebView *aboutHTML = [[UIWebView alloc] init];
NSURL *webURL = [NSURL URLWithString:@"http://apple.com"];
NSURLRequest *webURLRequest = [NSURLRequest requestWithURL:webURL];
[aboutHTML loadRequest:webURLRequest];
[aboutHTML setScalesPageToFit:YES];
[aboutHTML setFrame:CGRectMake(0, 0, 320, 416)];
[self addSubview:aboutHTML];}

1个回答

UIWebView *web = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
[web loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] 
                            pathForResource:@"help" ofType:@"html"]isDirectory:NO]]];
web.backgroundColor = [UIColor clearColor];