I have an entity called Files with attributes name, id etc. with a toMany relation with other entity called Category having catId.
I am trying to get data which matches Files.catId within an array of ids.
I am writing a predicate as
var idArray: [Int] = [410, 436, 435]
let catIdPredicate = NSPredicate.init(format: "fileCategory.catId IN %@", idArray)
which is giving me error as Unable to parse the format string "'fileCategory.categoryId' IN ( 410, 436, 435 )
Can anybody tell me how do I write a predicate for the same?
NSPredicate(format: "fileCategory.catId IN %@", categoryArray)
where categoryArray will be [410, 436, 435] - Shubham Bakshilet predicate = NSPredicate(format: "ANY fileCategory.catId in %@", categoryArray)
- iOSer