UIWebview 展示一个 xml 文件。使用了NSURLRequest 但是 UIWebview 显示一片空白。我把代码贴到下面了,不知道有方法能从网站获取文件然后显示吗?
NSString *htmlFile=[ [NSBundle mainBundle] pathForResource:@"location" ofType:@"xml"];
NSData * htmlData=[NSData dataWithContentsOfFile:htmlFile];
[aWebView loadData:htmlData MIMEType:@"text/text" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@""]];