Can a view controller own a sheet?

为君一笑 提交于 2019-12-13 19:19:54

问题


I want to call a sheet from within a view controller (user clicks on a button and the sheet will be displayed). Can the sheet have a separate window controller (with outlets and actions) or does the view controller from which the sheet is called operate as the sheet's controller?

I'm trying to determine how to display a sheet from a separate Interface Builder (.xib) file than my view controller. The sheet will have a list based on a popup menu item, so I would like to put that "logic" in a separate controller. I tried using a NSWindowController, but that didn't work.


回答1:


A stock NSViewController controls a view; nothing more. You can make a custom subclass that owns the sheet, or you can make it own a window controller which owns the sheet. The choice is yours.

Tried using a NSWindowController, but that didn't work.

You should ask another question about that.



来源:https://stackoverflow.com/questions/6240554/can-a-view-controller-own-a-sheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!