How to display sets of images when the application loads in the iPhone SDK?

advertisements

I want to display series of images one by one when the app loads. Basically I want to create some kind of animation by loading these images sequentially.

I know it is possible. I have seen many apps which does that.

Can you please let me know how can this be done?

Thanks!


Take a look at UIImageView's animationImages property. You can assign an NSArray of images to this property. Below is an example but there may be typos as i'm typing this from memory.

-(void)viewDidLoad
{
UIImageView *flower = [[UIImageView alloc] init];
flower.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"bloom1.png"],[UIImage imageNamed:@"bloom2.png"], [UIImage imageNamed:@"bloom3.png"], nil]; //add more images as necessary

flower.animationDuration = 1.00;
flower.animationRepeatCount = 1;
[flower startAnimating];

[self.view addSubview:flower];

[flower release]
}