0
我需要加載doc和ppt文件在UIWebView
。 我在一個控制器中有兩個不同的UIWebView
。UIWebview加載ppt和文檔崩潰應用
[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
。
我試試你的代碼,但它不」幫助。 'NSString * pdfPath = [[NSBundle mainBundle] pathForResource:@「doc」ofType:@「doc」]; NSData * myData = [NSData dataWithContentsOfFile:pdfPath]; [self.webview loadData:myData MIMEType:@「application/msword」textEncodingName:@「utf-8」baseURL:nil]; [self.webview1 loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[[NSBundle mainBundle] pathForResource:@「ppt」ofType:@「ppt」]]]];'此錯誤 OfficeImport'WrdEshReader :: readClientAnchor(EshContentBase&, EshHeader const&):0x34bc79b8:str.w r4,[r0,#348] – user2545330
我想你的doc文件有問題,請嘗試另一個文件 – Retro
doc文件中沒有問題,如果我嘗試加載它這兩個'webview'它工作得很好,但如果不同類型的文件在不同的webview中的一個線程崩潰的應用程序 – user2545330