Re: How to use NSTimer correctly?
Re: How to use NSTimer correctly?
- Subject: Re: How to use NSTimer correctly?
- From: Alexander Bokovikov <email@hidden>
- Date: Sat, 25 Jul 2009 23:04:34 +0600
On 25.07.2009, at 21:29, Adam R. Maxwell wrote:
Your original post said you're trying to do this at quit, but you
can't rely on any object being sent -dealloc at application quit
time. Do your cleanup in applicationWillTerminate:, either as the
app delegate or by registering for the notification. You definitely
don't want to use [self release].
Probably I've found the reason. The "Release when closed" flag was set
in the Window properties. Therefore my NSTableView has been released
as soon as I clicked window close button, but other application parts
like AppController still were active and timer still generated its
events.
As far as I understand now, this flag "Release when closed" may be set
only for a window without any interaction, like a message window, etc.
I's not correctly to set this flag, when there are some objects,
referring to the closed window content. This is just my case.
Another question arrives - who will release this window and when it
will be released? My AppController is set as NSApp delegate, and it
responds to "applicationShouldTerminateAfterLastWindowClosed" message
"YES". Does it mean that NSApp will release this my window?
Also I see windowWillClose message in the API reference. It's
described : "Sent by the default notification center". What does it
mean? What is this default notification center and how to get this
message? Should I set my AppController, as the window delegate to
receive it?
Thanks.
_______________________________________________
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