Going to the next line after an input instead of refreshing

Discussion in 'iOS Programming' started by gryym, Jul 21, 2008.

  1. macrumors newbie

    Jul 14, 2008

    I am stumped about how to make texts that's derived from an input like a UITextField, onto a textView and make it such that after each input, the previous sentences are not erased. What I am looking for is instead of updating or refreshing the outputs, they are instead 'pushed' onto the next line.

    Currently I am using UITextView as the output for the texts as it is scrollable.

    Thanks in advance!
  2. macrumors 6502

    Apr 28, 2008
    Just a guess but try something like:

    myTextView.text = [myTextView.text stringByAppendingString: myTextField.text];
    That will put the most recent input at the end of your text view, it you want it to be at the beginning, you'd do:

    myTextView.text = [myTextField.text stringByAppendingString: myTextView.text];
  3. thread starter macrumors newbie

    Jul 14, 2008

    Dude, you really helped me a bunch! That line of code was basically what i needed. Thanks a lot bro. :)

Share This Page