瀏覽代碼

【综合】减少Document创建

lizhe 7 月之前
父節點
當前提交
4608012cfd
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      PDF Office/PDF Master/Class/Document/KMMainDocument.swift

+ 4 - 4
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -505,11 +505,11 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         // Insert code here to read your document from the given data of the specified type, throwing an error in case of failure.
         // Alternatively, you could remove this method and override read(from:ofType:) instead.  If you do, you should also override isEntireFileLoaded to return false if the contents are lazily loaded.
         
-        let pdfDocument = CPDFDocument.init(data: data)
+//        let pdfDocument = CPDFDocument.init(data: data)
         self.pdfData = data
-        if pdfDocument == nil {
-            throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil)
-        }
+//        if pdfDocument == nil {
+//            throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil)
+//        }
     }
     
     // MARK: Autosaving