本文介绍了viewDidLoad在NSViewController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPhone我做UIViewController viewDidLoad和写一些设置代码来设置视图。

但是我怎么能在NSViewController?

我试过loadView,但它不工作...
也许我做错了,我不知道...



PS:我刚刚开始使用OSX / iOS对于OS X 10.10, viewDidLoad

/ code>可在 NSViewController 上使用。



在此之前, Snow Leopards的中的这个块:


in iPhone I do UIViewController viewDidLoad and write some setup code to setup the view.
But how can I do that in NSViewController?
I've tried with loadView but it doesn't work...Maybe I do something wrong I don't know...

PS: I've just started with OSX / iOS programming, so sorry if I ask something stupid :(

解决方案

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:

这篇关于viewDidLoad在NSViewController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 16:53