Re: Animated split view collapsing
Re: Animated split view collapsing
- Subject: Re: Animated split view collapsing
- From: Greg Herlihy <email@hidden>
- Date: Mon, 24 Apr 2006 05:47:50 -0700
- Thread-topic: Animated split view collapsing
The call to release the animation object is fine as is - especially since
startAnimation will not return until the animation has ended anyway. And
even if the animation did not block, releasing the animation would still be
OK because startAnimation retains the animation and autoreleases only once
it has finished. So in either case, releasing the animation looks OK.
Greg
On 4/24/06 3:25 AM, "John Buckley" <email@hidden> wrote:
> On 23/04/06, Lawrence Sanbourne <email@hidden> wrote:
>> Thanks for the help. Here's what I get when the code runs:
>>
>> NSViewAnimation *animation = [[NSViewAnimation alloc]
>> initWithViewAnimations:[NSArray arrayWithObject:windowResize]];
>> [animation setAnimationBlockingMode:NSAnimationBlocking];
>> [animation setDuration:0.5];
>> [animation startAnimation];
>> [animation release];
>
> Don't release the animation here; it will be dealocated. Make your
> controller the animation's delegate and then release it in the
> animationDidEnd: and animationDidStop: delegate methods.
>
> Alternatively you can just make the animation a member variable and
> only alloc/release once.
>
> John
>
> --
> ------------------------
> Dr. John Buckley
> email@hidden
>
> Mac OS X Tiger
> ------------------------
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden