• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Choppy Core Animation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Choppy Core Animation


  • Subject: Re: Choppy Core Animation
  • From: Scott Anguish <email@hidden>
  • Date: Fri, 2 Nov 2007 06:05:10 -0400

OK, one comment off the top.

I see no Core Animation in this example. This is strictly NSViewAnimation or Animatable proxies.

Which part doesn't work?

is it when you have layer backing turned on? or off?

what does your drawing method look like?



On Nov 1, 2007, at 7:14 PM, Hasani Hunter wrote:

Fellow list members..

I have been round and round with my choppy resize animation. Basically I have a custom view in IB that contains 3 subviews. I am trying the iTunes "show/hide" artwork effect. Basically I have a NSTableView that is wrapped in a custom nsview that displays financial transactions and the view underneath displays a detailed view of the selected transaction. To trigger the resize, the user just double-clicks the transaction and I resize both custom nsviews. shrinking the deatil view down and expanding the transaction view so that the transaction nstableview takes up any remaining space. I am guessing that I am redrawing excessively which might be causing the "choppiness". I am open to any and all suggestions. I have pasted the relevant code below.

Thanks,
Hasani

Utilities.m -----------------------------------------------------------

/**
* Sets the frame for a view with animation.
*/
+(void)setFrameForViewWithAnimation:(NSView *)view frame:(NSRect)frame
{

if ( [ view wantsLayer ] )
{
[ [ view animator ] setFrame:frame ];
}
else
{
NSRect startFrame = [ view frame ];

// create the dictionary..
NSMutableDictionary *animationDictionary = [ [ NSMutableDictionary alloc ] init ];

// set the target
[ animationDictionary setObject:view forKey:NSViewAnimationTargetKey ];

// set the starting size..
[ animationDictionary setObject:[ NSValue valueWithRect:startFrame ] forKey:NSViewAnimationStartFrameKey ];

// set the end frame
[ animationDictionary setObject:[ NSValue valueWithRect:frame ] forKey:NSViewAnimationEndFrameKey ];

// construct the animation..
NSViewAnimation *animation = [ [ NSViewAnimation alloc ] initWithViewAnimations:[ NSArray arrayWithObject:animationDictionary ] ];

// set the duration of the animation..
[ animation setDuration:0.25 ];

[ animation startAnimation ];

[ animation release ];
}

}
_______________________________________________


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

_______________________________________________

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


  • Follow-Ups:
    • Re: Choppy Core Animation
      • From: Hasani Hunter <email@hidden>
References: 
 >Choppy Core Animation (From: Hasani Hunter <email@hidden>)

  • Prev by Date: Re: Core Data app saving zero length files
  • Next by Date: Re: Collection was mutated while being enumerated
  • Previous by thread: Choppy Core Animation
  • Next by thread: Re: Choppy Core Animation
  • Index(es):
    • Date
    • Thread