I am using Realm with Swift for a query, but am receiving this error:
Terminating app due to uncaught exception 'Invalid value', reason: 'Expected object of type int for property 'id' on object of type 'JournalEntryLine', but received: 0'
The JournalEntryLine class does have a property (Int) named id
.
The code I'm using:
for item in idSet
let idQuery = realm.objects(JournalEntryLine).filter("id = '\(item)' AND type = 'Debit'")
}
idSet
is a set containing integers 0 and onward. I have confirmed that at least [0] is always in the set before running this query.
Why am I getting this error?