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
You need to:
textView.text = @"your string of text";
where textView is your UITextView object.
4 Comments
Malloc
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?
Matteo Alessani
try with:
for (int i=0; i<100; i++) { textView.text += @"String number"; }Malloc
i don't think that was helpful :) it gives me error : ` error: invalid operands to binary + (have 'struct NSString *' and 'struct NSString *')`
Matteo Alessani
you're right. try:
for (int i=0; i<100; i++) { textView.text = [textView.text stringByAppendingString:@"String number"] ; }