viewWillAppear equivalent for earlier version of OSX 10.10

114 Views Asked by At

life cycle methods (viewDidLoad, viewWillAppear, viewDidAppear etc) are available since OSX 10.10 Yosemite. Then how to used viewWillAppear in OSX 10.8,10.9 is there any other options for Lower version OS.

1

There are 1 best solutions below

1
Dmitry Serov On

These lifecycle methods are used in NSViewController class. In order to achieve similar functionality you could use NSWindowController's windowDidLoad and windowWillLoad methods.

Keep in mind that you (if you use Apple's MVC) will also have to move all your view logic from NSViewControllers to NSWindowControllers since ViewControllers do not participate in the responder chain on APIs earlier than 10.10.