How to get reference to parent view controller in Cocoa?

时间:2015-04-30 10:24:45

标签: macos cocoa swift nsview nsviewcontroller

I know in CocoaTouch there is the parentViewController property for this but there seems to no such property in Cocoa for OSX development. How can I ref the parent view controller in a sub view controller?

1 个答案:

答案 0 :(得分:1)

没关系!我是个白痴!我在View类中检查过这个,而不是在View Controller类中检查过。 NSViewController确实有一个parentViewController属性。