Im trying to display a word picked at random on an action from my array
Ive looked at Randomize words but still not getting it to work.
My label text is _answer
in my viewDidLoad:
NSArray *words = [NSArray arrayWithObjects: @"Blue", @"Green", @"Red", nil ];
NSString *str=[words objectAtIndex:arc4random()%[words count]];
under my action method:
[_answer setText:[NSString stringWithFormat:@"%d", arc4random()%[words count]];
I get an unused string error for str
And in my action method I have an error use of undeclared identifier "words"
but its in the viewDidLoad