random string - how to - needed
- I got a single string to print to a text field but random strings still dont.
DO LOOP:
a. generate a random number between 1-20
b. apply the random number to a string variable (ie, create string 1, string 2, string x)
c. display the string to a text field
my code started with the example in the documentation, eg:
NSString *str = [NSStringstringWithFormat:@"THIS TEXT IS FINE"];
This works fine but I want the text field to randomly display any of 20 different strings.
So - include a random number generator ala:
int randomInt = (arc4random()%20) +1;
But how to insert or bind or somehow associate the random number to the string variable, string1, string15, string20 ?
this is the hard part, at least for me....
Finally display the string to the text field in my GUI:
textview2.text = str;
Ive been reading up on NSLog but its just not clear how to use it, or if I really need it.