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 ....優秀。謝謝!! –