What is a standard way to add a ViewController in a Mac OS X Cocoa app? (or is it required?)

后端 未结 2 2032
情书的邮戳
情书的邮戳 2021-02-06 02:23

I\'d like to start a Cocoa app with a ViewController just like the iOS \"Single View App\" template, but there is no such template (is there a public / open source

2条回答
  •  悲&欢浪女
    2021-02-06 02:52

    On OS X NSViewController isn't as often used as UIViewController on iOS. One of the reasons is that it's not really useful and lacks a lot of the nice features of UIViewController. There are only a couple of situations where you really have to use them, like when using an NSPopover.

    There are several ways to structure your OS X code. One of them is using NSWindowController. You can think of NSWindowController as the equivalent of UIViewController on iOS.

提交回复
热议问题