barrycenter/BAMEasyTable — Issue #2: Unable to deal with array of Dictionaries
Author: autodidakto
Created: 2012-01-22 02:33:42+00:00
State: open

If an array of dictionaries is loaded, textStringMethodName isn't enough to pull out the text via objectForKey. I don't know if this is the best solution, but I added a dictionary class check:

````Obj-C
else if ([currentObject isKindOfClass:[NSDictionary class]])
cell.textLabel.text = [(NSDictionary *)currentObject objectForKey:textStringMethodName];
````
after

````Obj-C
if ([currentObject isKindOfClass:[NSString class]]) cell.textLabel.text = (NSString *)currentObject;
````
inside

````Obj-C
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
````
And a similar but slightly more involved change is necessary inside

````Obj-C
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
````