I'm making my first iOS app, and am in need of some help. Here is how it'll work:
User enters word in a textfield, presses a button and in the label it should be like this:
[Users word] [Randomly picked word]
.
So I think that I should make an array with the random words and then somehow randomize them when the button is pressed to display a random word out of many after the word the user entered in the text field.
But how is it supposed to work? Here is what I was thinking:
randomizing this (don't know how though):
NSArray *words = [NSArray arrayWithObjects: @"Blue", @"Green", @"Red", nil ];
and here is the code for displaying the text from the textfield:
NSString *labeltext = [NSString stringWithFormat:@"%@", [textField text]];
if I put label.text = labeltext;
then it displays the word typed by the user, but I'm stuck at the "displaying random word from array" part.
Any help appreciated!