Differentiate between no selection and selection at index 0 in UITableView
I have a UITableView and a UIButton. When the UIButton is pressed,开发者_如何学运维 it prints the text of the UITableViewCell that is selected to the console output.
However, when no selection is made on the UITableView, it defaults to row 0, and displays this text.
How can I determine if there is no selection made, so that I can bring up a UIAlert?
Perhaps you can try storing the index of the cell when the didSelectRowAtIndexPath: method triggers. That way you can keep track of whether the user has selected a row since the view has been shown
精彩评论