Possible Duplicate:
viewDidLoad in NSViewController?
I started development on iOS apps and am now moving to Mac OS X apps. I was wondering if there's an equivalent method in Mac OS X that is like iOS's viewDidLoad to run code after a View Controller launches.
Thank you!
The difference between viewDidAppear and viewDidLoad is that viewDidAppear is called every time you land on the screen while viewDidLoad is only called once which is when the app loads.
viewDidLoad() Called after the view controller's view has been loaded into memory.
From the Apple 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With