I’m trying to add two buttons to each cell in a tableview, but when I add them as subviews, only one of the buttons is clickable as the logic would dictate.
btn1.frame = CGRectMake(210,4,100,40);
btn2.frame = CGRectMake(250,4,100, 40);
[cell.contentView addSubview:btn2];
[cell.contentView addSubview:btn1];
Is there way to add two buttons and be able to click both?
Your buttons layers intersect. Look at your frames:
So now you should change your buttons
framesso that they won’t intersect.Some text from Apple Docs:
CGRectMake
Returns a rectangle with the specified coordinate and size values.