I have a table, I have cellForRowAtIndexPath delegate for it and I have instance of UITableViewCell being created inside that method, which I return. Somewhere in cellForRow
Hey, I know this is an old post but this can be helpful : UITableView will try to propagate its selection state in the whole hierarchy of its subviews. If one subview responds to -setHighlighted: it will be updated according to the cell selection state.
That explains why the button becomes blue (highlighted), but also why the button image disappears sometimes : a UIButton contains UIImageView instances to display its images and will swap the image of each image view according to its state (-[UIControl state]). But the table view cell comes and sets the highlighted flag of the button's image view to YES (which the button did not foresee), but this image view has no image for its highlighted state, so you see nothing, even if the button keeps swapping images according to its state.
The solution I used was, whenever the cell is selected or highlighted, I set the highlighted flag of the button's image view to NO.