UIButton with the tag property
I am getting my UIButton with its tag bay name by using.
UIButton *mybutton=[[UIButton alloc]init];
mybutton=(UIButton*)[cel开发者_如何学Cl viewWithTag:5];
and with UIButton* mybutton=(UIButton*)[cell viewWithTag:5];
This is fine.but when i change it's text(with tag button) by using
[mybutton setTitle:@"hello" forState:UIControlStateNormal];
App Crashes with this error
[UITableViewCell setTitle:forState:]: unrecognized selector sent to instance 0x4b6f540'
* Call stack at first throw:
Any Solution??
Thanks in advance
Use with your contentView
mybutton=(UIButton*)[cell.contentView viewWithTag:5];
精彩评论