我有一个表格视图,当用户按下其中一个单元格时,我不知道如何访问行号。表视图的数据是一个小数组,这是我能来的最接近的......在 IB 中,我控制将可重用单元格拖到我推送的视图控制器上,它工作正常。我不确定如何在这样的条件下获取行号......
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// A bunch of stuff is before this, but not important to the question
//-- > This line if([indexPath row] == 1) This doesn't work... any ideas?
{
if(totalPoints < 10 && number != 0)
{
[self saveNumber:@"1"];
}
else if (totalPoints < 10 && attachment == 0)
{
[self saveData:@"1"];
int newPnts = totalPoints + 1;
[self savePoints:[NSString stringWithFormat: @"%d", newPnts]];
}
谢谢