On the iPhone I use UIViewController
's viewDidLoad
to run code to set up the view.
How can I do that with NSViewController
?
I've tried loadView
but it doesn't work...
On the iPhone I use UIViewController
's viewDidLoad
to run code to set up the view.
How can I do that with NSViewController
?
I've tried loadView
but it doesn't work...
As of OS X 10.10, viewDidLoad
is available and supported on NSViewController
.
Prior to that, you had to go by this nugget in Snow Leopards' release notes:
Advice for People who Are Looking for -viewWillLoad and -viewDidLoad Methods in NSViewController
Even though NSWindowController has -windowWillLoad and -windowDidLoad methods for you to override the NSViewController class introduced in Mac OS 10.5 does not have corresponding -viewWillLoad and -viewDidLoad methods. You can override -[NSViewController loadView] to customize what happens immediately before or immediately after nib loading done by a view controller.