On Tue, 01 Jan 2013 20:15:00 +0800, Roland King <r...@rols.org> said:
>I have a UITextField with a delegate. I implement textFieldShouldReturn: and 
>that returns a BOOL value. The docs say this about the return value
>
>YES if the text field should implement its default behavior for the return 
>button; otherwise, NO.
>
>I've never seen any difference in behaviour between returning YES or NO. What 
>is this default behaviour I'm asking it to do, or not do? 

It has to do with the Did End on Exit control event; this event, if hooked up, 
causes the keyboard to be dismissed when the user taps the Return button, 
*unless* textFieldShouldReturn: stops it by returning NO. That is why, as my 
book explains, the best way to get automatic dismissal of the keyboard is to 
hook up Did End on Exit (possibly nil-targeted and uncaught) and either return 
YES from textFieldShouldReturn: or don't implement it at all. You can get 
automatic keyboard dismissal with *no code* this way.

http://www.apeth.com/iOSBook/ch23.html#_uitextfield

m.

--
matt neuburg, phd = m...@tidbits.com, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 5! http://shop.oreilly.com/product/0636920023562.do
_______________________________________________

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

Reply via email to