• 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
static method to create CABasicAnimation: does this create a memory leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

static method to create CABasicAnimation: does this create a memory leak?


  • Subject: static method to create CABasicAnimation: does this create a memory leak?
  • From: Miles <email@hidden>
  • Date: Thu, 9 Apr 2009 17:00:40 -0700

I have created a static method creating and returning an animation that I
use in various places in my application. I think this may be causing a leak.
If I autorelease theAnimation in the return statement I get a crash because
I the animation must be being release before it's complete.
Is this indeed causing a leak? If so, is there another way to do this
without a leak?


+(CABasicAnimation *)fadeIn {

CABasicAnimation *theAnimation;
theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.fromValue = [NSNumber numberWithFloat:0];
theAnimation.toValue = [NSNumber numberWithFloat:1.0];
theAnimation.duration = 1.0;
return theAnimation;
}

then I us it like this:


CABasicAnimation *anim = [AnimationCreatorUtil fadeIn];
anim.delegate = self;
[[scoreHolderView layer] addAnimation:anim forKey:@"fadeIn"];

Thanks!
_______________________________________________

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: static method to create CABasicAnimation: does this create a memory leak?
      • From: Marcel Weiher <email@hidden>
    • Re: static method to create CABasicAnimation: does this create a memory leak?
      • From: Randall Meadows <email@hidden>
  • Prev by Date: Re: Request for good advise to programmatically locate iMovie 09
  • Next by Date: Re: Send click to window
  • Previous by thread: Re: Reversing OS X Menu Bar and Menus for True RTL Language Applications
  • Next by thread: Re: static method to create CABasicAnimation: does this create a memory leak?
  • Index(es):
    • Date
    • Thread