I have database of about 10.000 entities and dynamic NSArray of 50 NSString elements. Goal is to check if each of those elements exist in database and create new array of ones that exist. I don't need to return full objects from database, just those NSString titles ( which are the same as in NSString array)
NSPredicate should compare entity.title to NSString element with EXACT match.
What is the best and processor/memory efficient way to do it?
EDIT:
One idea is to use
and then FOR EACH loop for creating new array from results.
Is this solution optimal, performance wise? Or there are better ones?
NSPredicate should compare entity.title to NSString element with EXACT match.
What is the best and processor/memory efficient way to do it?
EDIT:
One idea is to use
Code:
NSPredicate(format: "title IN %@", arrayName)
Is this solution optimal, performance wise? Or there are better ones?
Last edited: