Hello, I have been trying to set up an animation in xcode for a long time now, At first I started trying to animate 100 1000x1000 pngs, but those images were too big for the iphone, now I am trying to animate 100 320x480 pngs and it seems to animate fine up until about 40 frames in, then the app crashes, so, is there any other method of animation that wouldn't do this? It's probably just because this code loads too much images for the iphone to handle, is there some other method i can use to get the app to stop crashing? Or can I optimize this code further? (By the way i'm new to the iphone platform so keep in mind when answering)
- (IBAction)startClick1:(id)sender{
spud123.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed: @"spud1230000.png"],
[UIImage imageNamed: @"spud1230001.png"],
[UIImage imageNamed: @"spud1230002.png"],
[UIImage imageNamed: @"spud1230003.png"],
[UIImage imageNamed: @"spud1230004.png"],
[UIImage imageNamed: @"spud1230005.png"],
[UIImage imageNamed: @"spud1230006.png"],
[UIImage imageNamed: @"spud1230007.png"],
[UIImage imageNamed: @"spud1230008.png"],
[UIImage imageNamed: @"spud1230009.png"],
[UIImage imageNamed: @"spud1230010.png"],
[UIImage imageNamed: @"spud1230011.png"],
[UIImage imageNamed: @"spud1230012.png"],
[UIImage imageNamed: @"spud1230013.png"],
[UIImage imageNamed: @"spud1230014.png"],
[UIImage imageNamed: @"spud1230015.png"],
[UIImage imageNamed: @"spud1230016.png"],
[UIImage imageNamed: @"spud1230017.png"],
[UIImage imageNamed: @"spud1230018.png"],
[UIImage imageNamed: @"spud1230019.png"],
[UIImage imageNamed: @"spud1230020.png"],
[UIImage imageNamed: @"spud1230021.png"],
[UIImage imageNamed: @"spud1230022.png"],
[UIImage imageNamed: @"spud1230023.png"],
[UIImage imageNamed: @"spud1230024.png"],
[UIImage imageNamed: @"spud1230025.png"],
[UIImage imageNamed: @"spud1230026.png"],
[UIImage imageNamed: @"spud1230027.png"],
[UIImage imageNamed: @"spud1230028.png"],
[UIImage imageNamed: @"spud1230029.png"],
[UIImage imageNamed: @"spud1230030.png"],
[UIImage imageNamed: @"spud1230031.png"],
[UIImage imageNamed: @"spud1230032.png"],
[UIImage imageNamed: @"spud1230033.png"],
[UIImage imageNamed: @"spud1230034.png"],
[UIImage imageNamed: @"spud1230035.png"],
//and so on to 100
nil];
[spud123 setAnimationRepeatCount:1];
spud123.animationDuration =5.7;
[spud123 startAnimating];
}
Ps: Iv'e tried NSTimer, but I can't get that to stop repeating the animation