objective c - Making a conditional for table view buttonpress -
i have table view , don't know how access row number when user presses 1 of cells. data of table view small array , closest come... in ib, control dragged reusable cell view controller push works fine. unsure how row number in conditional this...
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { // bunch of stuff before this, not important question //-- > line if([indexpath row] == 1) doesn't work... 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]]; }
thanks
it should work
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { nslog(@"%@",indexpath.row); if(indexpath.row==1) { nslog(@"do somthing.."); } else { nslog(@"do somthing.."); } }