【发布时间】:2014-07-10 12:50:46
【问题描述】:
我需要在UIWebView 中加载doc 和ppt 文件。
我在一个控制器中有 2 个不同的 UIWebView。
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"doc" ofType:@"doc"]]]];
[self.webview1 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"ppt" ofType:@"ppt"]]]];
这会使应用程序崩溃:
OfficeImport`WrdEshBackground::takeClientData(WrdEshClientData*):
0x34c4fe3c: str.w r1, [r0, #224] //on this line
但是如果我加载相同格式的文件:
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"ppt" ofType:@"ppt"]]]];
[self.webview1 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@"ppt" ofType:@"ppt"]]]];
效果很好。
如果我在UIWebView 完成加载第一个请求时等待,然后从第二个开始它运行良好。
但是我需要在 tableView 中加载很多文件。 UITableViewCel 将包含加载此文件的 UIWebView。
【问题讨论】:
标签: ios objective-c uitableview uiwebview