• 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: NSTimer retain and release questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSTimer retain and release questions (From: Kyle <email@hidden>)
 >Re: NSTimer retain and release questions (From: Bill Bumgarner <email@hidden>)
 >Re: NSTimer retain and release questions (From: Bill <email@hidden>)

  • Prev by Date: Re: NSTimer retain and release questions
  • Next by Date: Re: NSTimer retain and release questions
  • Previous by thread: Re: NSTimer retain and release questions
  • Next by thread: Re: NSTimer retain and release questions
  • Index(es):
    • Date
    • Thread