I would like to be able to search for object relationships using the IN clause. I have the following setup: 
I would like to send an array of aliases and find all the individuals associated with these nicknames.
//array of names to find let nameArray: [String] = ["Tom", "Tommy", "Thomas"] // find all Persons who have a nickname associated with that person let predicate = NSPredicate(format: "ANY Person.nickName in %@",nameArray) var fetch = NSFetchRequest(entityName: "Person") fetch.predicate = predicate var fetchError : NSError? = nil // executes fetch let results = context?.executeFetchRequest(fetch, error: &fetchError)
But when I run the code, I get the following error:
'NSInvalidArgumentException', reason: 'unrealized SQL generation for the predicate: (ANY Person.nickName IN {"Tom", "Tommy", "Thomas"})'
What am I doing wrong here? If I delete the predicate search, it will return all the results in order, but as soon as I add this line, everything will break.
source share