On Nov 1, 2008, at 4:22 PM, Jeshua Lacock wrote:

On Nov 1, 2008, at 2:20 PM, Ashley Clark wrote:

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;

anim.duration = 3.0;

is also equivalent to

[anim setDuration:3.0];

The dot syntax for properties is just syntactic sugar.

So is that what you were recommending?

What I recommended was setting the duration on the animation directly, such as [anim setDuration:myDuration], or anim.duration = myDuration.

You rewrote all of your setters in dot-syntax, suggesting to me that you thought they were different in some way. They're not.


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?

// where someLayer is initialized elsewhere
CALayer *someLayer;

[someLayer addAnimation:anim forKey:@"imageFlipping"];

The key used at the end is just used as a way for you to remove your animation or retrieve it at a later point.

It is crashing with or without adding the animation, so it seems like CAKeyframeAnimation is not liking my images NSArray. They have valid memory addresses, and I am using the same array of UIImages somewhere else, so not sure what the issue might be.

I'm stumped!

As I understand the Core Animation framework, if you don't add the animation object to a layer none of its' methods will be called and none of the images you assigned to it will be accessed. So, if you're still crashing even when you're not adding the animation to a layer, your crash is because of some other over-released object. I'd suggest going over your code and making sure you're retaining all the objects you should be and releasing only the ones you created or took responsibility for.


Ashley

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to