根据UITextView中的文本内容,动态设置控件

来源:互联网 发布:2016网络红歌都有什么 编辑:程序博客网 时间:2024/06/05 02:19

最近项目中需要通过判断用户是否对资料进行更改,从而确定是否允许用户提交信息的功能,就以这种方式实现了。

使用前需要实现UITextViewDelegate协议,并设置UITextView的delegate。

- (void)textViewDidChange:(UITextView *)textView{    NSLog(@"[======]info introduction is %@",textView.text);    if (![textView.text isEqualToString:profile.introduction]) {        [self setRightBarButton];    }else    {        [self setRightBarItem:nil];    }}

0 0
原创粉丝点击