• 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: NSTimers and document based app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTimers and document based app


  • Subject: Re: NSTimers and document based app
  • From: Fritz Anderson <email@hidden>
  • Date: Wed, 8 Dec 2004 08:58:07 -0600

It sounds as though the document is either the target of the NSTimer, or is mentioned in the userInfo dictionary for the timer. In either case, it will be retained for the life of the timer.

	-- F

On 7 Dec 2004, at 8:28 PM, Ettore Pasquini wrote:

I'm experiencing a weird problem with a document based app. The application creates and starts NSTimers, one for each document. For the purpose of the app, when a document is closed I still need "its" timer. Therefore, I stored the timers in the AppController, so they are completely separated and NOT retained by the documents. (Each doc may eventually access its timer with an Id and an accessor method.)

The issue is that when I close a document, the document is not released if the timer is still running (and therefore leaks), but if I first invalidate the timer, the document is released. Also, by debugging the code I observed that during the [nstimer invalidate] call the retainCount for the document is misteriously decremented.

 --
Fritz Anderson
Consulting Programmer				Chicago, Illinois
http://resume.manoverboard.org/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTimers and document based app
      • From: Ettore Pasquini <email@hidden>
References: 
 >NSTimers and document based app (From: Ettore Pasquini <email@hidden>)

  • Prev by Date: Re: Click, activate window and select an object
  • Next by Date: Re: Drag and drop color swatches
  • Previous by thread: NSTimers and document based app
  • Next by thread: Re: NSTimers and document based app
  • Index(es):
    • Date
    • Thread