实时输出TextField中内容

要想实时输出TextField中内容,要找到textField内容发现改变就会调用的函数,即

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
    return YES;
}

输出实时的内容需要我们组合下,代码如下:

[textField.text stringByReplacingCharactersInRange:range withString:string];

 

posted @ 2016-05-16 13:47  ~道一~  阅读(358)  评论(0编辑  收藏  举报