2

I need to write on a TextView dynamically, actually my app retrieve data from database and need to display it on a UITextView, can any one help me there?

1 Answer 1

2

You need to:

textView.text = @"your string of text";

where textView is your UITextView object.

Sign up to request clarification or add additional context in comments.

4 Comments

Hi, thanx for your answer, i have one other question :` for (int i=0; i<100; i++) { textView.text = @"String number"; }` this loop suppose to display the sentence 100 times, but in my case it's displayed one time, why is that?
try with: for (int i=0; i<100; i++) { textView.text += @"String number"; }
i don't think that was helpful :) it gives me error : ` error: invalid operands to binary + (have 'struct NSString *' and 'struct NSString *')`
you're right. try: for (int i=0; i<100; i++) { textView.text = [textView.text stringByAppendingString:@"String number"] ; }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.