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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to