Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- copyLists = [[NSMutableArray alloc] initWithArray:sortedList copyItems:YES];
- - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
- {
- [self.filteredList removeAllObjects]; // First clear the filtered array.
- NSArray *objcts = unfilteredList;
- for (NSDictionary *section in objcts)
- {
- for (NSDictionary *row in [section valueForKey:@"Rows"])
- {
- NSRange rng = [[row valueForKey:@"name"] rangeOfString:searchString options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch)];
- if (rng.length != 0)
- [self.filteredList addObject:row];
- }
- }
- // Return YES to cause the search result table view to be reloaded.
- return YES;
- }
- NSArray *rows;
- if (tableView == self.searchDisplayController.searchResultsTableView)
- {
- rows = filteredList;
- } else {
- NSDictionary *section = [unfilteredList objectAtIndex:indexPath.section];
- rows = [section objectForKey:@"Rows"];
- }
- cell.textLabel.text = [[rows objectAtIndex:indexPath.row] objectForKey:@"name"];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement