Raphael Lim Raphael Lim - 1 year ago 58
Objective-C Question

Repeating my text on my textView Objective C

How do I make the following script repeat the text input into it?

self.textView.text = self.userTextInput

The above script was written as a text input from a
but I want it to loop 10 times in its text viewer, how do I write that?


Answer Source

Use following code to get your desired result.

NSMutableString *teststring = [NSMutableString string];
for(int i = 0; i<10;i++)
[teststring appendString:self.userTextInput];
self.textView.text = teststring;