didSelectRowAtIndexPath not working on sdk 3.0

2019-08-19 01:50发布

问题:

I was working on an app in SDK 2.x and everything was working fine, but now I have updated my SDK to 3.0 and found:

didSelectRowAtIndexPath 

of tableview is not working.

Anyone know why this is happening?

回答1:

The Table View Programming Guide says:

"You can control whether rows are selectable when the table view is in editing mode by setting the allowsSelectionDuringEditing property of UITableView. In addition, beginning with iPhone OS 3.0, you can control whether cells are selectable when editing mode is not in effect by setting the allowsSelection property."

So if things changed from 2.2.1 to 3.0 perhaps you have allowsSelection set to NO.