I have two buttons. One button shows the next image in a NSArray, but not only the next image in order but the button shows a random image from this array every time pressed. My second button is what I need help with Its a previous button that will display the previous image shown in the view every time pressed sort of like a slide show. I want to know how to make this previous button. I been told to Add an array property and each time the next method is fired, have it push the resulting image into the array, then the previous method would just recall images from the array, but I dont know how to implement this in code I am new at this. Please if anyone can supply some code that will make this previous button do this
-(IBAction)nextbutton

id)sender;
{
int ptr = rand() % 6;
NSArray *images = [[NSArray alloc] initWithObjects:@"Americans.png",@"Approach.png",@ "Arianny.png",@"Atoms.png",@"Australia.png",@"Aver age.png",nil];
}
above is my next button how will i make my previous one??