iOS 11 NSPredicate search on Swift array crashing - NSUnknownKeyException
问题 I am using NSPredicate to filter an array in Swift. The problem is after updating to iOS 11 (Xcode 9 /w Swift 4), I keep getting a crash on the filter line. Here is the crash log: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: >'[ valueForUndefinedKey:]: this class is not key >value coding-compliant for the key name.' Here is an example of the class that I have an array of: final class Model: NSObject { let name: String init(name: String) { self.name = name } }