Going to the next line after an input instead of refreshing

Discussion in 'iPhone/iPad Programming' started by gryym, Jul 21, 2008.

  1. macrumors newbie

    Joined:
    Jul 14, 2008
    #1
    Hi,

    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

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

    Code:
    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:

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

    Joined:
    Jul 14, 2008
    #3

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

Share This Page