Joined: May 25, 2003 Posts: 4752 Location: Santa Barbara, CA
Posted: Mon Feb 23, 2004 1:54 pm Post subject: [NSApp run] and Notification Centers
I'm at work and doing some Cocoa hacking and ran into another interesting reason that it's a Good Thing (TM) to move Cocoa hacks to [NSApp run]...
When using the event pull loop model like Neo used to, the automatic handling of the Windows menu in the handle given by [NSApp setWindowsMenu] is broken. Windows are added in, but they are never successfully removed. After a little research, it appears that the problem lies with the default notification center. NSWindowWillCloseNotifications never seem to get sent to observers registered on the default notification center. This makes it seem like dispatch of posted notifications in the default notification queue are handled by more voodoo within [NSApp run]. It also seems the standard Window menu processing handles removal of windows through these notifications.
Shouldn't affect the new event handling, but I figured I'd make a note for posterity and other Cocoa hackers.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum