Re: NSTimers and document based app
Re: NSTimers and document based app
- Subject: Re: NSTimers and document based app
- From: Ettore Pasquini <email@hidden>
- Date: Thu, 9 Dec 2004 15:42:38 -0800
It was just like you described: it was passed inside the userinfo
dictionary. Thank you - I don't know why I didn't see it.
Ettore
On Dec 8, 2004, at 6:58 AM, Fritz Anderson wrote:
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/
--
http://cubelogic.org/
Please support Free Software: http://www.gnu.org/philosophy/
_______________________________________________
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