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

NSTimers and document based app


  • Subject: NSTimers and document based app
  • From: Ettore Pasquini <email@hidden>
  • Date: Tue, 7 Dec 2004 18:28:24 -0800

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.

Any insight greatly appreciated.

-ep

_______________________________________________
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: Fritz Anderson <email@hidden>
  • Prev by Date: Re: delay function
  • Next by Date: Responder Chain and NSDocumentController
  • Previous by thread: Re: Registering for NSNotification globally?
  • Next by thread: Re: NSTimers and document based app
  • Index(es):
    • Date
    • Thread