1
我試圖通過didFailWith error
代表法的問題是我無法理解這個錯誤,請幫我加載我WebView
它顯示錯誤的.xls MS-Excel文件。裝載的.xls MS-Excel文件顯示錯誤
這裏是我的代碼: -
-(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}.
http://stackoverflow.com/questions/2131430/reading-open-xml-documents-in-ios – Woodstock