Quote:
Originally Posted by loddy1234
If i have a list of strings e.g "Yes", "No", "Maybe" e.t.c. Is there a code I can write to select a random one from the list? Please keep it simple as possible with comments as I am fairly new to objective C.
Thanks in advance
|
In principle, this is what you would do...Someone else can give you the code for it.
1. Load the strings into a MutableArray.
2. Use a random number generator such as arc4random() to pick the object in the array.
If you've done this before in another language, it is extremely easy...if not, it can be a headache.