I have an NSArray
of custom objects that all have a @property name
of type NSString
. How can I quickly enumerate through the array and cre
Please have a look at NSPredicates
! They are highly efficient when you are searching / filtering through array results. This is the documentation!
NSString *searchString = @"dog";
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.name contains %@", searchString];
NSArray *filteredArray = [testArray filteredArrayUsingPredicate:predicate];