Problem in autocapitalization of text
I had problem in auto capitalization. I want to enter a product name which contains only a-z and 0-9. So I had taken nameField.keyboardType = UIKeyboardTypeNamePhonePad. I want first letter to be capital letter so I had taken nameField.autocapitalization = YES. when I entered product name for first it is taking capital letter which is working fine. But the problem is occurred: when I entered product name and I had poped to anot开发者_如何学Cher view controller with out saving product name. next time if I want to enter product name it is not taking capital letter.
Please help me
Thank You Praveena Nalajala.
In :
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
Test if you enter first letter and if YES do an [string capitalizedString]
精彩评论