我總是試圖使用NSPredicate
篩選我的境界數據庫時出現以下錯誤。這是我已經試過:過濾境界與斯威夫特
let realm = try! Realm()
let predicate = NSPredicate(format: "typez.text.filter = 'special'")
let filterThis = realm.objects(Publication).filter(predicate)
print(filterThis)
我的模型類的相關部分是:
class Publication: Object, Mappable {
dynamic var id: Int = 0
var typez = List<getType>()
dynamic var url: String?
}
class getType: Object, Mappable {
dynamic var text: String = ""
}
什麼是您的'發佈'對象實現? –
可以在這裏找到:http://stackoverflow.com/questions/36835805/objectmapper-get-array-of-one-item-within-json – SoundShock