欠數組操作the Realm NSPredicate cheatsheet它指出我們可以作出這樣通過NSPredicate
目標的List
特定要素的查詢。但是,我總是得到一個「'valueForKeyPath:'函數不受支持。」例外,當我嘗試以下。的「valueForKeyPath:」不支持的功能
let realm = try! Realm()
let persons = realm.objects(Person.self)
let predicate = NSPredicate(format: "orders[0].created == $created")
persons.filter(predicate.withSubstitutionVariables(["created": Date()]))
我使用的Xcode 8.3.3中定位iOS 9.0與境界2.8.2
您是否找到了解決方案? –