Using UIImageView for a flipbook anim on iphone

Posted by Joey on Stack Overflow See other posts from Stack Overflow or by Joey
Published on 2010-05-15T21:02:04Z Indexed on 2010/05/15 21:04 UTC
Read the original article Hit count: 349

Filed under:
|
|
|

I'm using UIImageView to run a flipbook anim like this:

mIntroAnimFrame = [[UIImageView alloc] initWithFrame:CGRectMake( 0, 0, 480, 320);
mIntroAnimFrame.image = [UIImage imageNamed:@"frame0000.tif"];

Basically, when determine it is time, I flip the image by just calling:

mIntroAnimFrame.image = [UIImage imageNamed:@"frame0000.tif"];

again with the right frame. Should I be doing this differently? Are repeated calls to set the image this way possibly bogging down main memory, or does each call essentially free the previous UIImage because nothing else references it? I suspect the latter is true.

Also, is there an easy way to preload the images? The anim seems to slow down at times. Should I simply load all the images into a dummy UIImage array so they are preloaded, then refer to it when I want to show it with mIntroAnimFrame.image = mPreloadedArray[i]; ?

© Stack Overflow or respective owner

Related posts about uiimageview

Related posts about animation