Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试制作一个用于名称的 UITextField,但无法弄清楚如何将其仅限于字母。我知道只有数字是可能的,但是字母怎么可能呢?
使用委托并实现:
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
在此处验证替换字符串。