On Wed, Apr 22, 2015, at 06:03 PM, Jens Alfke wrote: > > Kyle, you may have forgotten that -textFieldAtIndex: is a method > specifically declared in UIAlertView. It’s not some general-purpose > method inherited from UIView. The documentation (see below) even > helpfully tells you which field is the password field.
"Forgotten" is being generous. I was just plain wrong. -textFieldAtIndex: is not (the nonexistent) -subviewAtIndex: My apologies to you, Rick. > > Removing the text field or changing its frame might constitute “messing > with”, but giving it focus seems like a perfectly reasonable thing to do. This is complicated; first responder is a window-global state, so it gets difficult to reason about interactions and dependencies. It's not unreasonable to want the text fields of an alert to gain first responder status when the alert appears, and UIAlertController should be making that happen. Ideally, UIAlertView would as well, but it obviously is exhibiting a bug. That said, UIAlertController is the way forward, and adopting it should fix the bug _today_ and prep Rick's app for _tomorrow_. > > Back to the question at hand — some of the other discussion makes me > suspect that -didPresentAlertView: is getting called earlier than it used > to, maybe before the alert is actually fully presented. So try adding a > delayed-perform so the text field’s focus will get set slightly later. This diagnosis seems likely, but I don't like the prescription, Doctor. ;-) --Kyle Sluder _______________________________________________ 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]
