I have a prototype cell which with a button and a label in it. The text of the label changes for each cell. I have set up an @IBAction
for the button and would like to get the text for the label in the cell in which the button in pressed. Does anyone know how to do this?
I hope it will help you.
- (IBAction)buttonHandler:(id)sender{
UIButton *button = (UIButton *)sender;
UITableViewCell *cell = (UITableViewCell *)button.superview;
println("%@",cell.textLabel.text)
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.