我有一個表格視圖,不知道當用戶按下其中一個單元格時如何訪問行號。表視圖的數據是一個小數組,這是最接近的我可以來...在IB中,我控制拖動可重用單元格視圖控制器我推,它工作正常。我不確定如何獲得有條件這樣的行數...製作表格視圖的條件buttonpress
- (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]];
}
感謝
你試過'indexPath.row'? – aroth
是的,但它仍然不起作用它很奇怪 – V2Krazy
indexPath.row應該工作。在你嘗試的地方顯示代碼。 – rdelmar