How to take notice when an NSWindow is about to be opened or have just opened? That is, the opposite of windowWillClose: delegate method (likewise the opposite of NSWindowWillCloseNotification.)
This is related to this question, but from the other direction.
The background is, I'm looking to couple a window with a tickmark on the main menu (among other things). When the window is shown, the corresponding ̨ menu item should be checked and vice-versa.
By macOS 10.10, this is somewhat solved by the call to
NSViewController'sviewWillAppearorviewDidAppear. Have anNSViewControllersubclass and set it as thecontentViewControllerof the window. Then itsviewWillAppear/viewDidAppearimplementation can post a notification that the window will (or did) open.