I'm trying to run an animation by changing the images of my UIImageView at a 20 fps rate. I need about 100 images of 24K to create a 5 sec animation. I am able to load all the images into the memory (into an NSArray), but when I start the animation (switching the UIImage of the UIImageView) - after about 60 images I get a memory warning and if I continue displaying images the app crashes.
I have tried several ways to load the images - first was imageNamed which turned out to cache all images into the memory hence couldn't load more than about 40 images, and after that tried using initWithContentsOfFile (which doesn't cache the images) which helped in loading all the images to the memory, but still when i animated them it caused memory problems and eventually a crash.
I think I'm doing something wrong... these are the main areas I'm not sure about:
1. how come displaying an image (24K) that was already loaded into memory (and not cached) takes about 200ms? What's the fastest way to display an already loaded image?
2. Is there some kind of a display memory that is different from the RAM (like on a graphic card or something) that can be cleared on demand/increased?
3. Any general suggestions as for how to run the animation better?
I'm really lost here so any help would be appreciated, Thanks
I'm trying to run an animation by changing the images of my UIImageView at a 20 fps rate. I need about 100 images of 24K to create a 5 sec animation. I am able to load all the images into the memory (into an NSArray), but when I start the animation (switching the UIImage of the UIImageView) - after about 60 images I get a memory warning and if I continue displaying images the app crashes.
I have tried several ways to load the images - first was imageNamed which turned out to cache all images into the memory hence couldn't load more than about 40 images, and after that tried using initWithContentsOfFile (which doesn't cache the images) which helped in loading all the images to the memory, but still when i animated them it caused memory problems and eventually a crash.
I think I'm doing something wrong... these are the main areas I'm not sure about:
1. how come displaying an image (24K) that was already loaded into memory (and not cached) takes about 200ms? What's the fastest way to display an already loaded image?
2. Is there some kind of a display memory that is different from the RAM (like on a graphic card or something) that can be cleared on demand/increased?
3. Any general suggestions as for how to run the animation better?
I'm really lost here so any help would be appreciated, Thanks
memory problems imageNamed
you can send me code [initWithContentsOfFile]