I am trying to pull objects out of my core data store by passing in an array of strings, and pulling only the objects that have a category matching what's in the array.
I have been able to get this code to work, except that it only uses the first item in the array, and won't iterate through the array and match the rest of the items.
This is the code that works for that. I am using the NSPredicate overload that accepts and array.
func filterTopicCategories() {
fetchController.topicFetchRequest.predicate = NSPredicate(format: "topicCategory == %@", argumentArray: selectedCategories)
topicsToSelectFrom = fetchController.fetchTopics()
}
I've poured through that Apple docs on predicates and all that, and can't seem to quite figure it out. I've spent a few hours searching around google as well. I am not sure if I am just not understanding something correctly, or if I am just doing it completely wrong, I am not sure. Any help would be greatly appreciated.
Thanks