NSString* year = [self.years objectAtIndex:[indexPath section]];
//get algorithms for that year
NSArray* algorithmSection = [self.algorithmNames objectForKey:year];
NSLog(@"%@", indexPath);
//get specific algorithm based on that row
cell.textLabel.text = [algorithmSection objectAtIndex:indexPath.row];
return cell;
无论什么原因,当我编译这个时,我得到一个SIGABRT错误。它发生在NSArray SIGABRT
cell.textLabel.text
行。错误:
2011-08-29 19:26:21.273 XXXXXXXXXXX [1431:B303] 2个索引[0,0]
2011-08-29 19:26:21.274 XXXXXXXXXXXXX [1431:B303] - [__NSCFDictionary objectAtIndex:]:无法识别的选择发送到实例0x4ba2370
2011-08-29 19:26:21.277 XXXXXXXXX [1431:B303] *终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因:“ - [ __NSCFDictionary objectAtIndex:]:无法识别的选择器发送到实例0x4ba2370' 终止调用抛出异常
嗯,我怎么能解决这个问题,同时保持相同的信息传递? –
如果您不知道如何存储数据,我无法告诉您。据推测,你可以使用适当的键替换对'-objectAtIndex:'调用'-objectForKey:'的调用,以访问要在单元格的textLabel上设置的文本。 – lemnar
oo ....优秀。谢谢!! –