BAMEasyTable icon indicating copy to clipboard operation
BAMEasyTable copied to clipboard

Unable to deal with array of Dictionaries

Open ghost opened this issue 13 years ago • 0 comments

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:

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

after

if ([currentObject isKindOfClass:[NSString class]]) cell.textLabel.text = (NSString *)currentObject;

inside

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

And a similar but slightly more involved change is necessary inside

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

ghost avatar Jan 22 '12 02:01 ghost