I've taken the Seismc XMl example and adjusted it to my needs, I've added a tab bar controller with multiple tabs each with a TableView, so far so good, I now want to filter the main TableView, so that different info appears in each of the TableViews based on category.
I've created a class for each filter "type" in the app delegate, and I'm trying to create a new array for each filter, these arrays are based based on the master Earthquake array that the Apple sample uses, e.g
- (NSArray *)FilterByArtCategory { NSPredicate predicate = [NSPredicate predicateWithFormat:@"kCategory like[c] \"a*\""]; NSArray *filteredArray = [self.currentEarthquakeObject filteredArrayUsingPredicateredicate]; return filteredArray; }
Then in the Art category view controller
@implementation ArtViewController
(NSArray *)states { return [(StatesAppDelegate *)[[UIApplication sharedApplication] delegate] FilterByArtCategory]; }
(UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"stateCell"]; cell.text = [[self.states objectAtIndex:indexPath.row] valueForKey:@"genre"]; return cell; }
However nothing appears in my ArtViewController table view, I get a warning saying "Earthquake may not respond to filteredArrayUsingPredicate" for NSArray *filteredArray =.
So I guess the array isn't being created properly. I a bit confused about how the Seismic XML example creates the array objects, I understand basic array examples but I'm a bit lost here , am I missing something obvious?
Help would be greatly appreciated...