views:

40

answers:

1

I have a ViewController consisting of just a textView. In its viewDidLoad method, I simply initialize the textView and add it as a subview. In my main ViewController class, when the user presses a button, I switch views and display the view that has the textView. I am trying to change the textView's text however it is not working. Can I not change the text of a UITextView at runtime?

Thanks.

A: 

You should keep a reference to your text view.

If you do, then make sure that the reference is correct and valid before setting the new text.

In general, it always helps when you post a problematic code - this way it is much easier for us to help you...

Michael Kessler