How to use NSPredicate for whether a List of Int contains a Int number?
问题 I got a Realm model Person who has a tag property. let tags = List<Int>() Now, I would like to perform a search like this realm.objects(Person.self).filter(NSPredicate(format: "\(tagID) IN tags")) // "0 IN tags" Error: Terminating app due to uncaught exception 'Invalid value', reason: 'Expected object of type (null) for property 'tags' on object of type 'Person', but received: 0' 回答1: As stated in David's comment, you cannot filter on a list of primitives. You can only filter on List's that