我有两个基于单元格的表格(项目和类别)。我试图得到正确的行索引,因此我可以使用它们的数组。使用两个表格 - 如何获得正确的行
到目前为止我的代码是这样的:我使用了错误的方法,或者是我
currentCategory is Cat One
currentCategory is Cat Three
currentCategory is Cat One
currentCategory is Cat Three
currentCategory is Cat One
currentCategory is Cat Three
currentCategory is Cat Two
currentCategory is Cat One
currentCategory is Cat Three
...
:
- (id) tableView:(NSTableView *)tableView
objectValueForTableColumn:(NSTableColumn *)tableColumn
row:(NSInteger)row {
//NSLog(@"%s", __FUNCTION__);
if (tableView.tag == 0) {
currentItem = [itemMutableArray objectAtIndex:row];
NSString *itemTitle1 = [currentItem valueForKey:@"title"];
return itemTitle1;
} else {
currentCategory = [categoryMutableArray objectAtIndex:row];
NSString *catName = [currentCategory valueForKey:@"name"];
NSLog (@"currentCategory is %@", catName);
return catName;
}
}
但每个表,这将返回类似?谢谢。
什么问题了吗? – Undo
我希望能够识别每个表的特定行。 –
我们需要知道数组的内容以及日志*应该说的内容。 – Undo