Re: [iPhone 3.0] -- UIImage imageFromContentsOfFile and animations
Re: [iPhone 3.0] -- UIImage imageFromContentsOfFile and animations
- Subject: Re: [iPhone 3.0] -- UIImage imageFromContentsOfFile and animations
- From: David Duncan <email@hidden>
- Date: Thu, 13 Aug 2009 09:38:44 -0700
On Aug 12, 2009, at 11:03 PM, John Michael Zorko wrote:
However, though replacing imageNamed with imageFromContentsOfFile
works wherever I set a UIImageView's image property, doing so to
load the PNG images into my animation array results in the animation
being invisible on the device, though it works in the simulator.
Here's my code:
Try lengthening your animation time. I would bet that your
encountering a bug where the animation starts before all of the images
are ready and thus it skips some part of the animation. If your
animation is particular short, you just get completely skipped.
I've tried various combinations of the inDirectory parameter, to no
avail -- it plays on the sim, not on the device. However, using
UIImage imageNamed works on the device, but uses up a lot of memory
that causes my glitch.
The memory usage is the same in both cases, the only difference is
that +imageNamed: has already decompressed the image before it
returns. The image still must be decompressed in either case for the
animation to actually occur. When you use +imageNamed: your animation
likes works because the images are already ready.
But if your getting memory glitches, it sounds like your images are
awfully large...
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden