How can an array of objects be sorted by comparing one of their properties (NSString *) to objects (already sorted) in another array of (NSString *)s?
I fill an array of e.g. Person objects in the order a number of threads happen to complete in. I would then like to compare each Person.name against an array of name objects that is already ordered. The result would be the Person array sorted in the same order as the names array by the person.name property.
You could try something similar to this, with very little details this the best I could come up with:
This code loops threw the sorted array and checks if the unsorted array contains that same object. If it does it placed it in tmpArray. When if finishes it will have a sorted array with the items it contained.
Here’s a link I found using
NSPredicatefor a more optimized solution https://stackoverflow.com/a/2873439/507299.