views:

59

answers:

2

Hello,

I would like to imitate a behavior like the one that is in the apple calendar when selecting a date for an event. You have a TableView with to cells and a datepicker. If the first cell is selected the date of the picker is for start date and the opposite for end date.

So, my question is: how do I Know, when handling the date change in the DatePicker, what cell is being selected in tableview at that moment?

Thanks in advance for your help.

A: 
if ( 0 == [[yourTable indexPathForSelectedRow] compare:[yourTable indexPathForCell:yourCell]] ) {
  // yourCell is selected
}

or you might be able to tell just by looking at indexPathForSelectedRow.

drawnonward
A: 

I think you need to implement

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

and check indexPath.row

jkeesh