发生 UIButton 事件时阻止 didSelectRowAtIndexPath

Prevent didSelectRowAtIndexPath when a UIButton event occurs

我有一个 UITableViewCell,其中包含一个 UIButton。 table 视图要求为应用程序的其他功能实现 didSelectRowAtIndexPath,但是当点击此特定按钮时,会触发按钮事件,但也会触发 didSelectRowAtIndexPath。我正在寻找一种方法来防止在点击 UIButton 时触发 table 视图委托方法。谁能给个建议?

所以,原始单元格没有启用自动布局。不确定确切原因,但在启用自动布局和配置单元格后,按钮正常运行并且不再调用 didSelectRowAtIndexPath