I have two NSMutableArrays
: searchResults
and searchResultsDetails
. I sort searchResults with NSPredicate
, and I want searchResultsDetails
to be sorted based on which objects were removed from searchResults
with the NSPredicate
.
For example, let's say searchResults originally contains 1,2,3,4,5 and searchResultsDetails
originally contains A,B,C,D,E. So after sorting it with NSPredicate
, searchResults contains 1,2,5, and I want searchResultsDetails
to contain A,B,E. How can I accomplish this?
This is the code I am using to sort the first array.
NSPredicate *resultPredicate = [NSPredicate
predicateWithFormat:@"self CONTAINS %@",
searchText];
self.searchResults = [self.lines filteredArrayUsingPredicate:resultPredicate];