Re: NSTimer retain and release questions
Re: NSTimer retain and release questions
- Subject: Re: NSTimer retain and release questions
- From: "Sherm Pendley" <email@hidden>
- Date: Wed, 10 Sep 2008 15:02:56 -0400
On Wed, Sep 10, 2008 at 2:44 PM, Bill <email@hidden> wrote:
>
> Part of the reason I'm asking is because originally I used the above method
> with a retain (and released later with the invalidate method), and then ran
> my app with Leaks, and Leaks told me that the timer was leaking.
>
That's because it was leaking. You sent a -retain to an object, and you
didn't send it a corresponding -release, so the object leaked. You need to
balance *your own* use of -retain and -release to avoid leaks. What the
object does internally, retaining and/or releasing itself, is immaterial to
what you need to do with it from outside.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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