iOS限制UITextfield的字数
之前在cocoachina看到一篇文章http://www.cocoachina.com/ios/20160106/14889.html,挺实用的,非常好用,肯定以后可以遇到,登录的时候肯定能遇到 - (void)textFieldTextDidChanged:(UITextField *)sender { NSString * tempString = sender.text; if (sender.markedTextRange == nil && tempString.length > kMaxLength) { sender.text = [tempString substringToIndex:kMaxLength]; [sender.undoManager removeAllActions]; } }
标题名称:iOS限制UITextfield的字数
当前网址:http://hbruida.cn/article/ipopop.html