开发者

Can a view controller own a sheet?

开发者 https://www.devze.com 2023-03-10 17:15 出处:网络
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

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消