• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Customizing UIAlert keyboard behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Customizing UIAlert keyboard behavior


  • Subject: Re: Customizing UIAlert keyboard behavior
  • From: Matt Neuburg <email@hidden>
  • Date: Wed, 19 Dec 2012 21:15:47 -0800

On Dec 19, 2012, at 8:23 PM, email@hidden wrote:

> Message: 1
> Date: Wed, 19 Dec 2012 12:18:12 -0800
> From: Jens Alfke <email@hidden>
>
> 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 don't know what's up with the autocapitalization, but there is no expectation or contract that just because the keyboard dismissal key says Done it will also dismiss a surrounding alert. It's a text field feature, not an alert feature. If you want to dismiss the alert, dismiss it (in code). m.

--
matt neuburg, phd = email@hidden, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden


  • Prev by Date: Re: Making an automatic vertically expanding NSTokenField?
  • Next by Date: Re: "New" busy cursor in the Finder
  • Previous by thread: Customizing UIAlert keyboard behavior
  • Next by thread: iOS - needs-shine app pList setting being ignored on devices.
  • Index(es):
    • Date
    • Thread