Browse Source

Merge branch 'develop_PDFReaderProNew' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderProNew

tangchao 10 months ago
parent
commit
3332ea714d

+ 5 - 5
PDF Office/PDF Master/Class/PDFTools/OCRNew/Controller/KMLanguageViewController.swift

@@ -119,14 +119,14 @@ class KMLanguageViewController: NSViewController,KMLanguageTableCellViewDelegate
         return newTokens as! [String]
     }
     func tokenField(_ tokenField: NSTokenField, completionsForSubstring substring: String, indexOfToken tokenIndex: Int, indexOfSelectedItem selectedIndex: UnsafeMutablePointer<Int>?) -> [Any]? {
-        let arrayFilter = self.selectedLanguages.value(forKeyPath: KMGOCRLanguageStringKey) as? [Any]
-        let str = String(format: "NOT (SELF in %@)", arrayFilter ?? [])
-        let thePredicate = NSPredicate(format: "%@", str)
+        let arrayFilter = self.selectedLanguages.value(forKeyPath: KMGOCRLanguageStringKey) as? NSArray
+//        let str = String(format: "NOT (SELF in %@)", arrayFilter ?? "{}")
+        let thePredicate = NSPredicate(format: "NOT (SELF in %@)", arrayFilter ?? [])
         let arr: NSArray = self.builtInKeywords! as NSArray
         
         let newBuiltInKeywords: NSArray = arr.filtered(using: thePredicate) as NSArray
-        let str1 = String(format: "SELF beginswith[cd] %@", substring)
-        let matches = newBuiltInKeywords.filtered(using: NSPredicate(format: "%@", str1))
+//        let str1 = String(format: "SELF beginswith[cd] %@", substring)
+        let matches = newBuiltInKeywords.filtered(using: NSPredicate(format: "SELF beginswith[cd] %@", substring))
         return matches
     }