Search code examples
macoscocoaswiftnsviewnsviewcontroller

How to get reference to parent view controller in Cocoa?


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?


Solution

  • Nevermind! I'm an idiot! I've checked for this in a View class, not in a View Controller class. The NSViewController does indeed have a parentViewController property.