How can i recognize when user close a window ?
i want to do something before window close.
I use it in a viewcontroller
//initWithNibName
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:self.view.window];
- (void)windowWillClose:(NSNotification *)notification
{
NSWindow *win = [notification object];
//...
}