Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get notified when NSWindow closes

how can I take notice when an NSWindow should or will get closed? I'd like to have something like the windowWillClose. Unfortunately NSWindowController does not have as much convenient methods as UIViewController has, for example. So what's the best practice to do that?

Thanks
–f

like image 537
flohei Avatar asked Nov 26 '10 14:11

flohei


1 Answers

According to the NSWindow docs, a window will post a NSWindowWillCloseNotification notification when it is about to close. Your controller can observe this notification.

like image 181
Ole Begemann Avatar answered Oct 07 '22 18:10

Ole Begemann