gpt4 book ai didi

cocoa - 在 Mac OS X 编程时,是否有与 viewDidLoad 等效的方法?

转载 作者:行者123 更新时间:2023-12-03 16:08:41 26 4
gpt4 key购买 nike

Possible Duplicate:
viewDidLoad in NSViewController?

我开始开发 iOS 应用程序,现在转向 Mac OS X 应用程序。我想知道 Mac OS X 中是否有类似 iOS 的 viewDidLoad 的等效方法,可以在 View Controller 启动后运行代码。

谢谢!

最佳答案

来自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.

关于cocoa - 在 Mac OS X 编程时,是否有与 viewDidLoad 等效的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4492485/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com