Text Input Traits - Return Key

Discussion in 'iOS Programming' started by toofah, Feb 22, 2010.

  1. toofah macrumors newbie

    Feb 22, 2010
    I am a newbie to iPhone dev...been doing other GUI dev for 15 years is various languages/technologies.

    Is there a "simple" way to use the IB 'Text Input Traits - Return Key' feature to move the cursor from one textbox to another to another and then to the "submit" button when the user hits 'return'?

    I know that I can setup a UITextFieldDelegate to handle textFieldShouldReturn and look at the textField passed in and then manually set a different textfield as the first responder, but shouldn't this be done automatically somehow? If I am setting "Next" or "Send" as the value of the Text Input Trait for Return Key, what does this do for me if this does not set something like this up? Shouldn't it just follow the tab order and move me to the next field without setting up any delegate code? It seems really funny to write code like this. Isn't there a way to set a 'default button' and have it get 'clicked' by hitting the return key?

    I feel like I must be missing a concept here.

    Thanks for your help,

  2. KoolStar macrumors demi-god


    Oct 16, 2006
    You would have to deal with text field responders. Such as asigning firstresponder to the next field when the user selects the return key. You will have to use the UITextFieldDelegate. You will have to know how many text fields you have unless you right a control that can gather all the text fields in an array. When your on the last textfield change the return to Submit and handle appropriately.

Share This Page