I’m popping up a UIAlert with a text field in it. I want the text field to 
auto-capitalize all words, and I want the Return key to dismiss the alert. I’m 
doing this by setting properties of the text field, but they have no effect at 
runtime. Here’s my code:

    UIAlertView* alert = [[UIAlertView alloc] initWithTitle: title
                                                    message: message
                                                   delegate: self
                                          cancelButtonTitle: @"Cancel"
                                          otherButtonTitles: @"Create", nil];
    alert.alertViewStyle = UIAlertViewStylePlainTextInput;
    UITextField* titleField = [alert textFieldAtIndex: 0];
    titleField.autocapitalizationType = UITextAutocapitalizationTypeWords;
    titleField.returnKeyType = UIReturnKeyDone;
    [alert show];

When I run this, (a) there is no auto-capitalization at all, and (b) pressing 
Return merely hides the keyboard. What else do I need to do? I’ve verified that 
titleField is not nil, so the properties are actually being set.

[Xcode 4.5.2. Have only tried this in the iOS 6 simulator yet, not on a real 
device.]

—Jens
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to