0

I have worked a lot with the UIKit from iOS SDK, now I'm getting familiar with the cocoa framework to develop applications for MacOS X. UIViewController has functions to implement the view controllers containment to make the UIViewController and the UIView hierarchies consistent between each other.

Is there something similar in cocoa? What are the best practices to have View from other NSViewController inside the hierarchy of the view controller by another NSViewController?

Jpellat
  • 907
  • 7
  • 29
  • Usually view controllers relate to each other using properties or outlets, but only when they need to know about each other. Views relate to each other in the NSView subview–superview hierarchy. It would help if you could make this question more concrete and indicate what you're trying to accomplish. – paulmelnikow Jun 29 '13 at 16:44
  • My question is about best practices. In iOS have inconsistent hierarchies between ViewControllers and view can raise an exception, in cocoa too? Or could make methods like viewDidAppear don't be called? I use this technique in several ways. An example could be have a viewController to handle the right view of a split view – Jpellat Jun 29 '13 at 16:52
  • In general you should avoid coupling view controllers to each other when possible, and couple them when you need to. There's no enforcement of a hierarchy of view controllers. – paulmelnikow Jun 29 '13 at 17:17

0 Answers0