CAAnimation delegate crash

81 views
Skip to first unread message

Amos

unread,
Jun 22, 2010, 3:14:06 PM6/22/10
to iPhone Wax
I'm really enjoying using wax. It allows me to get stuff done more
quickly than I could otherwise.

I've run into a strange problem. I'm creating a ca animation and
setting its delegate to my view controller.

animation = CABasicAnimation:animationWithKeyPath("opacity")
animation:setDuration(0.5)
animation:setRepeatCount(6)
animation:setAutoreverses(true)
animation:setFromValue(NSNumber:numberWithFloat(0))
animation:setToValue(NSNumber:numberWithFloat(1))
animation:setDelegate(self)
myLayer:addAnimation_forKey(animation, "blink")

I have a delegate call back function defined.

function animationDidStop_finished(self, theAnimation, flag)
print("animation stopped")
end

When the animation is cancelled before it ends (by calling
myLayer:removeAllAnimations() ) then the delegate call back function
works fine. However, when the animation finishes on its own the
program crashes rather than calling the delegate callback function.
There is no error message. If I use the debugger I get: Program
received signal: “EXC_BAD_ACCESS”

I note that if I comment out the delegate callback function then the
program doesn't crash (though the call back obviously doesn't get
called).

Does anyone have any ideas about what may be going on?

Thanks!

-Amos

Amos

unread,
Jun 22, 2010, 3:20:44 PM6/22/10
to iPhone Wax
Just a follow up with a little more information.

I've tried using a delegate class created in Objective C and it works
fine. No crashing.

I'm guessing that this a bug in Wax.

-Amos

corey johnson

unread,
Jun 22, 2010, 3:22:28 PM6/22/10
to ipho...@googlegroups.com
Are you using the master/release branch or the dev branch?

I think the dev branch http://github.com/probablycorey/wax/tree/dev
should fix this problem.

I really need to push dev to master soon!

Amos

unread,
Jun 22, 2010, 5:58:37 PM6/22/10
to iPhone Wax
> Are you using the master/release branch or the dev branch?

I am using the latest dev branch.

-Amos

corey johnson

unread,
Jun 22, 2010, 7:25:23 PM6/22/10
to ipho...@googlegroups.com
Ugh, that's no good then!

If you could create a super tiny project that demos the crash I can
dig in and find out what is going on.

Corey

Reply all
Reply to author
Forward
0 new messages