开发者

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜