Can a view controller own a sheet?

2019-08-04 00:04发布

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条回答
家丑人穷心不美
2楼-- · 2019-08-04 00:27

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.

查看更多
登录 后发表回答