• 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: "Stéphane Droux" <email@hidden>
  • Date: Sun, 1 Jun 2008 14:55:06 +0100

On Sun, Jun 1, 2008 at 1:15 PM, Gustavo Eulalio <email@hidden> wrote:

> Well, I'm novice to Cocoa/ObjC programming, so, I might be wrong. But
> I see you're setting a new frame on l2 every time fromTimer: is
> called, but you never release the old one. The following may solve it,
> if that's the problem.
>
> - (void) fromTimer: (NSTimer *) t
> {
>    [l2.frame release]
>     l2.frame = CGRectMake((double)random() / RAND_MAX*30, (double)random()
> /
>        RAND_MAX*30, (double)random() / RAND_MAX*40, (double)random() /
>        RAND_MAX*40);
>    l1.opacity = (double)random() / RAND_MAX;
> }
>
> Or are you using the garbage collector?
> By the way, shouldn't this be done via an accessor method? [l2
> setFrame:...]
>
>
frame is a CGRect readwrite property. It can be changed via l2.frame and
doesn't need any retain/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

References: 
 >Re: Leak when animating Core Animation Superlayer (From: Brian Christensen <email@hidden>)
 >Re: Leak when animating Core Animation Superlayer (From: "Stéphane Droux" <email@hidden>)
 >Re: Leak when animating Core Animation Superlayer (From: "Gustavo Eulalio" <email@hidden>)

  • Prev by Date: how to implement ETA
  • Next by Date: Re: Leak when animating Core Animation Superlayer
  • Previous by thread: Re: Leak when animating Core Animation Superlayer
  • Next by thread: Re: Leak when animating Core Animation Superlayer
  • Index(es):
    • Date
    • Thread