0

UPDATE:

i have MENUViewController and i insert this view to TableViewCell, when i press button on MENUViewController how to pass nextResponder to TableViewCell ?

from LOG at my button in MENUViewController class->NSLog(@"nextResponder = %@", self.nextResponder); it show like this?

2010-07-22 02:14:12.627 NewsReaderV2[3576:207] button Press
2010-07-22 02:14:12.653 NewsReaderV2[3576:207] nextResponder = <UITableViewCell: 0x5f33120; frame = (0 48; 320 129); autoresize = W; layer = <CALayer: 0x5f330d0>>
2010-07-22 02:14:13.987 NewsReaderV2[3576:207] button Press
2010-07-22 02:14:13.988 NewsReaderV2[3576:207] nextResponder = <UITableViewCell: 0x5f3a490; frame = (0 177; 320 129); autoresize = W; layer = <CALayer: 0x5f3a570>>
2010-07-22 02:14:18.019 NewsReaderV2[3576:207] button Press
2010-07-22 02:14:18.020 NewsReaderV2[3576:207] nextResponder = <UITableViewCell: 0x692b210; frame = (0 306; 320 129); autoresize = W; layer = <CALayer: 0x6925480>>

@END of UPDATE

i have insert button on each cell ,when i press on that button it will not send message to

  • (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

how to make responder from button send message to UITableViewController?

RAGOpoR
  • 8,118
  • 19
  • 64
  • 97

1 Answers1

1

If you want to select corresponding cell when button in it clicked - determine cell's indexpath in click handler (see similar question). Then call selectRowAtIndexPath:animated:scrollPosition: method on your table view.

Community
  • 1
  • 1
Vladimir
  • 170,431
  • 36
  • 387
  • 313
  • if my Button are in another class can you give me some advise? – RAGOpoR Jul 21 '10 at 11:15
  • Could you explain what exactly you can't do exactly? Handle button click, select tableView cell or something else... – Vladimir Jul 21 '10 at 11:37
  • Solution in the link I've posted should work for your case as well (see solution in Edit2) - you convert touch point to table view's coordinate and get nsindexpath using tableview's indexPathForRowAtPoint: method. All you need is have a reference to your tableview of course to call this methods and assign proper action to the button (that takes UIEvent paramater) – Vladimir Jul 22 '10 at 09:04