On Dec 19, 2012, at 8:23 PM, cocoa-dev-requ...@lists.apple.com wrote: > Message: 1 > Date: Wed, 19 Dec 2012 12:18:12 -0800 > From: Jens Alfke <j...@mooseyard.com> > > 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 = m...@tidbits.com, 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 (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com