ソースを参照

修改离线打开PDF文件路径设置。

Pen Li 9 年 前
コミット
e17c1ebae2

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 5 - 0
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m

@@ -137,6 +137,11 @@
     
     if(self.isLocalfile)
     {
+        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
+        NSString *cachefolder = [paths objectAtIndex:0];
+        NSString *pdfFolder = [cachefolder stringByAppendingPathComponent:@"pdf_cache"];
+        self.url = [pdfFolder stringByAppendingPathComponent:self.url];
+        
         self.content= [NSData dataWithContentsOfFile:self.url];
         [self.webView loadData:self.content MIMEType:@"application/pdf" textEncodingName:nil baseURL:nil];
         [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];