after ios14 update TableView:didSelectRowAtIndexPath is not called. Running the same source in ios13 works normally
tableview A Click to add to the parent view [self.superview addsubview:A] I added a table view like this So the delegate is received from the current view Until ios13 is normal, why not?
There are two methodologies:
First
When you're using UITableViewController then it's automatically conformed to UITableViewDataSource
and UITableViewDelegate
protocols.
@interface UITableViewController : UIViewController;
Second
In case you're using UITableView you have to conform it to both protocols – UITableViewDataSource
and UITableViewDelegate
and assign two class delegates.
@interface UITableView : UIScrollView;
@property(nonatomic, weak) id<UITableViewDelegate> delegate;
@property(nonatomic, weak) id<UITableViewDataSource> dataSource;
If both methodologies don't work, so it's definitely a bug in iOS 14.
About method:
tableView:didSelectRowAtIndexPath:
Apple documentation says:
The system doesn’t call this method if the rows in the table aren’t selectable. See Handling Row Selection in a Table View for more information on controlling table row selection behavior.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With