0

I have a view based tableview with a button which displays a popover:

enter image description here

How would I go about setting the selected to the row that holds the pressed button.

I'm using core data, with an array controller. I plan to have the tableview in the popover show related objects.

Myron Slaw
  • 886
  • 9
  • 21

1 Answers1

1

Just add a tag equal to row to every cell button, button.tag = indexPath.row; Then in your button's selector you just call

[self tableView:self.tableView didSelectRowAtIndexPath:[NSIndexPath indexPathForRow:button.tag inSection:0]];
Nikita Pestrov
  • 5,876
  • 4
  • 31
  • 66
  • I forgot to mention that everything is hooked up through bindings. I'm guessing you mean set up the button tag in tableView:rowForView:. I'll try subclassing the tableRowView and setting it up there. – Myron Slaw Apr 16 '12 at 23:17
  • You've got to do that in tableView:cellForRowAtIndexPath: – Nikita Pestrov Apr 17 '12 at 05:29