我在S/O上搜索,没有答案已经应用到我的代码,所以我假设我的代码中缺少的东西。UIWebView不显示HTML
我加了一个UIWebView
使用Interface Builder称为showAbout
我宣布这里有一个IBOutlet伊娃:
@interface About : UIViewController<UIWebViewDelegate>
{
IBOutlet UIWebView *showAbout;
}
@property (nonatomic, retain) IBOutlet UIWebView *showAbout;
我证实了InterfaceBuilder事实上确实有它设置一个出口。
这里是我如何设置它在about.m
showAbout.scalesPageToFit = YES;
NSString *thePath = [[NSBundle mainBundle] pathForResource:@"about" ofType:@"html"];
if (thePath) {
NSData *aboutData = [NSData dataWithContentsOfFile:thePath];
[showAbout loadData:aboutData MIMEType:@"application/html"
textEncodingName:@"utf-8" baseURL:nil];
的UIWebView中不显示,我已经添加到项目中我的HTML页面。
任何想法...
http://stackoverflow.com/questions/6263289/accesing-a-file-using-nsbundle-mainbundle-pathforresource-oftypeindirectory可能是你的问题。 – 2013-07-14 20:24:09
是关于数据无? –
@PaulCezanne,我没有设置从我的Mac这个赏金...将今晚检查和建议。 – logixologist