Raphael Lim Raphael Lim - 2 years ago 95
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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download