There is a button in my header of a UITableView
. Once the button is touched up inside, how could we know which section does the button belong to? As the tableview is editable, set the tag of the button is not that good when some rows is removed. I have tried using indexPathForRowAtPoint:
to get the indexPath of the first row belongs to the section, but something weird happened. Is there any better approach?
Edit 1:
Once the tag is used to identify the section number of a header, the tag will not update when the some row has been deleted. Of coz you can reload the tableview to update the tag, but it seems not that good.
For the weird behavior of indexPathForRowAtPoint:
, I have post another question: Weird behavior of UITableView method "indexPathForRowAtPoint:"