Re: Simple Flipbook Animation?
Re: Simple Flipbook Animation?
- Subject: Re: Simple Flipbook Animation?
- From: Jeshua Lacock <email@hidden>
- Date: Sat, 1 Nov 2008 13:58:52 -0600
On Nov 1, 2008, at 1:51 PM, Ashley Clark wrote:
On Nov 1, 2008, at 1:02 PM, Jeshua Lacock wrote:
On Nov 1, 2008, at 11:44 AM, Ashley Clark wrote:
Your crash is happening because you're releasing something you
shouldn't be. The CGImage you're getting from the UIImage was not
accessed through a Create* or Copy* function and therefore you are
not responsible for it and have no need to call the CGImageRelease
function.
Hmm, thanks for the tip. That is how the example I was following
was written.
But I removed the line and it is still crashing on the same line of
assembly code.
Do you think I need to use Create or Copy, alloc or something?
After looking at the example you were basing yours off of I see that
in that example the image was being created by another function
create_image(), in that case (depending on the function
implementation, but probably) you would be responsible for releasing
it. Here though, using the CGImage property of an UIImage, you're not.
I see.
What are the values of anim and images before you try to add them to
the animator? In the code portion you posted you don't show where
you're creating your "anim" object.
Yes, sorry, I realized that after I posted. I am creating anim before
it is used with:
CAKeyframeAnimation *anim;
anim=[CAKeyframeAnimation animationWithKeyPath:@"contents"];
I have also tried:
CAKeyframeAnimation *anim = [CAKeyframeAnimation animation];
And then setting the animationWithKeyPath property after it is created.
As well I don't see in my version of the SDK where UIAnimator is
defined. If you're trying to use private API here, don't. Just set
the duration on the anim object directly and add it to your CALayer.
You can get the layer used by a view by sending the layer message to
the view (NS or UI).
You mean directly by setting the properties like with:
anim.duration = 3.0;
anim.values = images;
anim.calculationMode = @"discrete";
anim.repeatCount = HUGE_VAL;
I have also tried that method.
I have tried adding it to the layer with:
[[self layer] addAnimations:anim withDuration:1.5 start:YES];
Is that what you mean? Or could you please show me an example?
Thank you very much for your help!
Best,
Jeshua Lacock
Founder/Programmer
3DTOPO Incorporated
<http://3DTOPO.com>
Phone: 877.240.1364
_______________________________________________
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