views:

180

answers:

1

I have 20 images and some audio. I would like to show a single image at a time and change the images at (unequal) intervals. For example, I want to show image 1 for 1.44 seconds and image 2 for 1.67 seconds and so on. Can someone suggest how to go about doing this please? What I have seen are examples that show how to setup an array of images with one field that denotes total time. This causes the images to show for an equal amount of time (each). ... and that not what I am looking for ...

A: 

Make an NSTimer with some time interval, say 1 second. When the timer fires, figure out how long you want the new slide to remain and use setFireData to set when the next timer should fire.

-(void) timerFired:(NSTimer *)inTimer {
    NSTimeInterval timeForSlide = [self advanceToSlideReturningDuration];
    if ( timeForSlide > 0 ) [inTimer setFireDate:[NSDate dateWithTimeIntervalSinceNow:timeForSlide]];
    else [inTimer invalidate]; // the show is over
}
drawnonward