PDA

View Full Version : Going to the next line after an input instead of refreshing




gryym
Jul 21, 2008, 10:54 PM
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!



Enuratique
Jul 22, 2008, 12:32 AM
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!

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];

gryym
Jul 22, 2008, 01:41 AM
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];



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