开发者

UIButton with the tag property

开发者 https://www.devze.com 2023-03-22 15:06 出处:网络
I am getting my UIButton with its tag bay name by using. UIButton *mybutton=[[UIButton alloc]init]; mybutton=(UIButton*)[cel开发者_如何学Cl viewWithTag:5];

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号