didselectrowatindexpath

didSelectRowAtIndexPath: not being called

不羁的心 提交于 2019-11-26 10:20:16
问题 I have a UITableView as a subview of my UIScrollVIew , which is the main view controlled by my MainViewController . In MainViewController.h @interface MainViewController : UIViewController <UIGestureRecognizerDelegate, UITableViewDelegate, UITableViewDataSource> // other stuff here... @property (weak, nonatomic) IBOutlet UITableView *myTableView; In MainViewController.m @synthesize myTableView; // other stuff here... - (void)viewDidLoad { myTableView.delegate = self; myTableView.datasource =

UITableView didSelectRowAtIndexPath: not being called on first tap

坚强是说给别人听的谎言 提交于 2019-11-26 04:05:07
问题 I\'m having an issue with UITableView\'s didSelectRowAtIndexPath . My table is setup so that when I select row it initializes a new view controller and pushes it. The first time I tap any row in the table, the method does not get called. Once I select another row, it begins to work as normal. I have verified this by setting a breakpoint on didSelectRowAtIndexPath . When adding an NSLog to the method I see that when I select the second row that finally pushes the new view controller, I see two

-didSelectRowAtIndexPath: not being called

偶尔善良 提交于 2019-11-26 01:48:49
问题 I\'m writing an iOS app with a table view inside a tab view. In my UITableViewController , I implemented -tableView:didSelectRowAtIndexPath: , but when I select a row at runtime, the method isn\'t being called. The table view is being populated though, so I know that other tableView methods in my controller are being called. Does anyone have any ideas what I may have screwed up to make this happen? 回答1: It sounds like perhaps the class is not the UITableViewDelegate for that table view,