kCAOnOrderOut animation not working

  • I'm using -defaultActionForKey: to add an animation when a sublayer is
    removed from its parent. My animation is never used and instead the
    sublayer fades out (which I assume is the default). But if I add the
    animation to kCAOnOrderIn it works as I expect.

    My sublayer class's defaultActionForKey: implementation looks like this:

    + (id<CAAction>)defaultActionForKey:(NSString *)key
    {
    if ([key isEqualToString:kCAOnOrderOut]) {
      return [MyAnimation animation];
    }
    return [super defaultActionForKey:key];
    }

    What do I need to do to change the order out animation?

    Thanks,

    Dion Crannitch
previous month may 2008 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Go to today