我正在尝试加载一个 .xls Ms-Excel 文件,WebView
它通过didFailWith error
委托方法显示错误,问题是我无法理解此错误,请帮助我。
这是我的代码:-
-(void)loadDocument:(NSString*)documentName inView:(UIWebView*)webView
{
NSString *path = [[NSBundle mainBundle] pathForResource:documentName ofType:nil];
NSURL *url = [NSURL fileURLWithPath:path];
NSData *data = [NSData dataWithContentsOfURL:url];
[webView loadData:data MIMEType:@"application/vnd.ms-excel" textEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@""]];
}
错误是:-
EXCEPTION CPMessageException: (null)
2013-09-25 12:35:47.051 ewApps-dev18[1111:c07] [ReportsWebView_iPhone.m:116] did fail with error:- Error Domain=OfficeImportErrorDomain Code=912
"Unknown exception" UserInfo=0x97a4970
{NSErrorFailingURLKey=x-apple-ql-id://B7559867-1117-4FF5-8F61-015464D8E2C7/x-apple-ql-magic/, NSErrorFailingURLStringKey=x-apple-ql-id://B7559867-1117-4FF5-8F61-015464D8E2C7/x-apple-ql-magic/, NSLocalizedDescription=Unknown exception}.