ios UITextField委托实现实时检测输入框的内容

发表时间:2013-03-13     分类:IOS    标签: ios delegate 

用UITextFieldDelegate实现,文本档的内容更新时,判断textfield的内容。- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSCharacterSet *cs; if(textField == phoneNumberField) { cs = [[NSCharacterSet characterSetWithCharactersInString:NUMBERS] invertedSet]; NSString *filtered = [[string component......

阅读全文»

  • 1 篇文章 1/1 页