【发布时间】:2010-12-06 04:32:28
【问题描述】:
在
中使用以下代码将 html 文件从 plist 加载到 webView 时遇到问题 FAQDetailViewController.m: - (void)viewDidLoad { [超级视图DidLoad]; NSString *Path = [[NSBundle mainBundle] bundlePath]; NSString *WebPath = [路径 stringByAppendingPathComponent:WebFile]; UIWebView *tempWeb = [[UIWebView alloc] initWithContentsOfFile:WebPath]; [webView 加载数据:tempWeb]; //我想我的问题就在这里。我不明白如何在这里实现代码 [tempWeb发布]; }在这里加载了 FAQViewController.m 中的代码:
FAQDetailViewController *faqdvController = [[FAQDetailViewController alloc] initWithNibName:@"FAQDetailView" bundle:[NSBundle mainBundle]]; faqdvController.WebFile = [字典 objectForKey:@"faqDesc"]; //来自plist文件的html文件放置在这里 faqdvController.hidesBottomBarWhenPushed = NO; [self.navigationController pushViewController:faqdvController Animation:YES]; [faqdvController 发布];【问题讨论】:
-
coneybeare 你能帮忙吗?我想它应该是
[webView loadData:tempWeb MIMEType:@"text/html" textEncodingName:@"UTF-8" baseURL:bundleBaseURL];