How to make the text of UITextField to appear with First letter Capital in iPhone

rkb picture rkb · Jul 25, 2009 · Viewed 33.4k times · Source

I have a text box and I am only interested in capitalizing the first letter, So how to do that in iPhone UITextField.

Answer

ennuikiller picture ennuikiller · Jul 25, 2009

try this:

tf = [[UITextField alloc] init];
tf.autocapitalizationType = UITextAutocapitalizationTypeSentences;

or set this property in the properties inspector in Interface Builder