I am new in ipad development i want to add the button in uitableviewcell but it is not displaying. how to add this button in tableview cell. I am writing this code in cellforRowAtIndexPath My code is:
UIButton *cellImgButton = [[UIButton alloc]initWithFrame:CGRectMake(300, 350, 40, 40)];
cellImgButton = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *buttonImage = [UIImage imageNamed:@"remove.png"];
[cellImgButton setBackgroundImage:buttonImage forState:UIControlStateNormal];
[cellImgButton addTarget:self action:@selector(cellImgButton:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:cellImgButton];
Thanks in Advance:
You can just create a prototype cell in interface builder and drag a UIButton in the cell. after that create a new UITableViewCell class and link the button.
don’t forget to add a identifier to the cell