hello everyone, I'm a new "developer" trying to build some iPhone app I'm making an app which gets text from a list of objects in a NSArray and then randomizes them and display one in a TextView, here's the code:
- (IBAction)azione{
NSArray *myArray= [NSArray arrayWithObjects: @"Pasta",@"Pizza",@"Wait",@"Go", nil];
int length = [myArray count];
int chosen = arc4random() % length;
testo.text = [myArray objectAtIndex: chosen];
}
what I want to do now, is when I open the app and get a random object, to take it out from the list, so that it won't be picked again
ex. I open the app>I get "Pizza">Do the action again>I don't get "Pizza" anymore, only "Pasta" "Wait" and "Go"
What should I do ? Which code should I use ?
Thanks for answers