Reputation: 75
Hello people in my application I wanted to do an animation. The animation has 160 frames and I wanted it to last 10 sec and make a loop.
For it created an Array with frames and a UIImageView.
UIImageView *animImageView;
...
NSArray *arrayAnim = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"image0001"],...,nil];
animImageView.animationImages=arrayAnim;
animImageView.animationDuration=10;
[animImageView startAnimating];
this results and get the animation but at the moment I do startAnimating my application is breaked for 7 seconds. is there any way to avoid this delay?
Upvotes: 1
Views: 147
Reputation: 58361
You're almost certainly using too much memory. 640 x 1136 x 4bpp = 2908160 bytes of memory per image. For 160 images that's 465 MB of RAM (more than then 3GS even has!)
Without knowing what your animation looks like, I suggest that you try to build the animation dynamically using UIViews and animating the subviews in real time rather than using pre-rendered frames.
Upvotes: 2