我编写了下面的代码来为我的表格视图中的每个单元格添加 UILabel 的所有标题,但是我不确定如何继续。由于索引部分,我得到了错误。
先感谢您
- (IBAction)addAllCellLabelNamesToList:(UIButton *)sender {
NSMutableArray*selected=[[NSMutableArray alloc]init];
for (int i =0;i<[_mainTable numberOfRowsInSection:0];i++) {
ListCell*cell=[_mainTable cellForRowAtIndexPath:i];//not usre what to put here
if (!cell.isSelected) {//if selected add to array
[selected addObject:cell.ingredientLabel.text];
}
}
}