Adding a button to a table cell
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
精彩评论