I have an application with the following code listed below that displays random questions for the end user. I am trying to figure out how to have a user be able to go navigate backwards in an array that is displayed randomly. For instance, a user is going through the questions and accidentally advances past one and wants to go back, I want them to be able to just simply hit a back button. Could you provide any guidance on how to do this? Thank you very much!!!
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
myArray5= [NSArray arrayWithObjects:
@"Question 1",
@"Question 2",
@"Question 3",
@"Question 4",
nil];
int chosen = arc4random() % [myArray5 count];
NSString *item = [myArray5 objectAtIndex: chosen];
label3.text = [NSString stringWithFormat: @"%@", item];
label3.alpha = 0;
label3.transform = CGAffineTransformIdentity;
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
label3.alpha = 1;
label3.transform = CGAffineTransformMakeScale(1, 1);
[UIView commitAnimations];
UITouch *touch = [[event allTouches] anyObject];
if (touch.tapCount == 2) {
}
}