0
我使用的Xcode 4.6試圖加載本地HTML文件中的IOS,但我不能加載它,它沒有出現在模擬器任何無法加載本地HTML文件中的IOS
我的代碼是
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"LocalPage" ofType:@"html" inDirectory:nil];
NSString* htmlString = [NSString stringWithContentsOfFile:htmlFile encoding:NSUTF8StringEncoding error:nil];
[self.webView loadHTMLString:htmlString baseURL:nil];
}
任何人都可以告訴我這是什麼問題?
你爲什麼要使用Xcode中的過時版本加載文件? – Mundi
可能的重複[如何加載本地HTML文件到UIWebView?](http://stackoverflow.com/questions/4645414/how-can-i-load-a-local-html-file-into-the -uiwebview) – Mani
此網頁視圖是否已添加到視圖層次結構中? –