NSSortDescriptor and NSPredicate for sorting and filtering
问题 I have a tableView that has 5 different possible datasources depending on a flag object (NSNumber *)dataSourceAssignment . I've implemented an NSSortDescriptor that sorts dataSource by a (float)confidenceRating . After the datasource is assigned, I need to be able to filter the dataSource array by a (NSString *)genre . I understand how to use NSPredicate to filter my array, but I can't figure out how to do it efficiently when there are 5-6 different genre strings that could be checked. The