• 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: Could somebody please fix NSTimer?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Could somebody please fix NSTimer?


  • Subject: Re: Could somebody please fix NSTimer?
  • From: Gordon Apple <email@hidden>
  • Date: Sat, 12 Jan 2013 14:16:46 -0600
  • Thread-topic: Could somebody please fix NSTimer?

And just how does one go about doing that?  The only way I can see is to use
an owner’s dealloc to call something like “wouldLikeToDealloc” on the owned
object.  From the literature, it appears that NSTimer is the main offender
in this regard.  I frequently use generic NSViewControllers and
NSWindowControllers which have no link to the controller containing the
timer.


On 1/12/13 1:05 PM, "Kyle Sluder" <email@hidden> wrote:

> On Jan 12, 2013, at 10:49 AM, Gordon Apple <email@hidden> wrote:
>
>> > When compiled under ARC, NSTimer should have a weak, not strong, reference
>> > to its target.  When the timer starts to fire, check the reference for nil
>> > and invalidate itself.  Come on guys, how hard is that?  You wouldn¹t even
>> > have to keep a reference to it, unless you want to invalidate it before the
>> > target deallocates.
>
> You should already be invalidating it before the target deallocates…
>
> --Kyle Sluder


_______________________________________________

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: Could somebody please fix NSTimer?
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: Could somebody please fix NSTimer? (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: HiDPI retina issue with multi-screen overlay window and Core Animation
  • Next by Date: Re: Could somebody please fix NSTimer?
  • Previous by thread: Re: Could somebody please fix NSTimer?
  • Next by thread: Re: Could somebody please fix NSTimer?
  • Index(es):
    • Date
    • Thread