Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When programming for Mac OS X, is there an equivalent to viewDidLoad? [duplicate]

Tags:

xcode

macos

cocoa

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!

like image 930
Mike Avatar asked Dec 20 '10 18:12

Mike


People also ask

What is the difference between viewDidLoad () and viewDidAppear ()?

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.

What does view did load do?

viewDidLoad() Called after the view controller's view has been loaded into memory.


1 Answers

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.

like image 168
Evan Mulawski Avatar answered Nov 15 '22 09:11

Evan Mulawski