Possible Duplicate:
Generate a random alphanumeric string in cocoa
I’m new to objective c and I would like to add the following functionality to my app:
I have a label which has default text after the app launches.
I want for that label to change to a random string each time the user clicks a button.
It does not matter if the string repeats itself eventually, as long as it is random.
I appreciate the help in advance.
You can use following code :
for generating the random string.
or
You can create array that contains number of strings. Assuming you created 10 strings and put them in an array then: