Add buttons programmatically to table view cells [closed]
I can add and delete cells to my table view. How to have two buttons for each cell that's added?
Add the button as subview for your cell. That's it. I have given the sample:
//Create your cell then do the following
UIButton *newBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[newBtn setFrame:CGRectMake(10,5,55,55)];
[newBtn addTarget:self action:@selector(yourSelector:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:newBtn];
精彩评论