KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to sort my array while using NSPredicate.. I have read other places that possibly using NSSortDescriptor could be an option. Having some trouble figuring this out. I am attempting to sort my array by companyName. Any advice appreciated, thanks Greg - (void)filterSummaries:(NSMutableArray *)all byNameThenBooth:(NSString*) text results:(NSMutableArray *)results { [results removeAllObjects]; if ((nil != text) && (0 < [text length])) { if ((all != nil) && (0 < [all count])) { NSPredicate *predicate = [NSPredicate predicateWithFormat: @"companyName contains[cd] %@ OR boothNumber beginswith %@", text, text]; [results addObjectsFromArray:[all filteredArrayUsingPredicate:predicate]]; } } else { [results addObjectsFromArray:all]; } }
Tags (comma-separated)
Save Edits
Cancel