0
我试图表明一个html
页是我的应用程序里面,但它并没有在视图上显示:由iOS - display content from an html resource file or remote webpage in a webview显示HTML页面在我的iPhone观点
:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask ,YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"abt.html"];
NSURLRequest *documentsRequest = [NSURLRequest requestWithURL:
[NSURL fileURLWithPath:path]] ;
[_webview loadRequest:documentsRequest] ;
我跟着这个链接马特吉布森
请让我知道如何显示。
感谢
这里可能有很多错误...... webView可能无法正确初始化,“Path”变量可能是空的。您需要提供更多信息。 –