• 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: Leak when animating Core Animation Superlayer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Leak when animating Core Animation Superlayer


  • Subject: Re: Leak when animating Core Animation Superlayer
  • From: Brian Christensen <email@hidden>
  • Date: Sat, 31 May 2008 18:14:06 -0400

On May 31, 2008, at 16:39, "Stéphane Droux" <email@hidden>

> When I run the program in MallocDebug, the memory usage goes up every time the timer function is executed. If I change the animation to be on l2 instead of l1, or if I create l2 as a sublayer of mainLayer, the memory usage remains constant. Am I doing something wrong ?


An NSTimer is not really the appropriate way to do this. Have a look at CABasicAnimation, which you might use in the following manner (untested code written on an iPhone, so no guarantees):


CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"opacity"];

[anim setFromValue:1.0];
[anim setToValue:0.2];
[anim setAutoreverses:YES];
[anim setDuration:1.0];

[l2 addAnimation:anim forKey:nil];

I would recommend reviewing the Core Animation documentation for additional examples.

/brian

_______________________________________________

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: Leak when animating Core Animation Superlayer
      • From: "Stéphane Droux" <email@hidden>
  • Prev by Date: Re: Possible Bug in NSFileManager -moveItemAtPath:toPath:error:
  • Next by Date: Re: ScriptingBridge to access Mail Messages?
  • Previous by thread: Leak when animating Core Animation Superlayer
  • Next by thread: Re: Leak when animating Core Animation Superlayer
  • Index(es):
    • Date
    • Thread