开发者

Adding a button to a table cell

开发者 https://www.devze.com 2023-03-09 22:20 出处:网络
I have added a button to a table and used the event met开发者_StackOverflow中文版hod to find out the indexpath of the cell it was pressed in to get information and update another entity.

I have added a button to a table and used the event met开发者_StackOverflow中文版hod to find out the indexpath of the cell it was pressed in to get information and update another entity.

Sometimes it doesn't return an indexpath even though I know the button was pressed.

Any help would be good please.


First off, is there a reason you aren't just using didSelectRow:atIndexPath to get the row and update your other entity?

This is a bit vague to provide an answer, but I would be suspicious of your cell re-use code in cellForRowAtIndexPath method. That is often where issues in table view cells are created... are you handling re-used cells properly with regard to this custom button?

-S

0

精彩评论

暂无评论...
验证码 换一张
取 消