On Sep 18, 2016, at 12:22 , mail...@ericgorr.net wrote:
> While I do see the log message 'How do I..', my utility panel is not shown.
> How can I get this work?

Most of the problem is that storyboards and segues for the Mac are inadequately 
documented. This is exacerbated by the fact that understanding the behavior “by 
analogy with iOS” breaks down when windows are involved, since there’s no such 
thing (AFAIK) as a segue between windows on iOS.

By trial and error, I discovered that the problem in your sample project is 
that a “show” segue from a view controller does not open a new window. This 
halfway makes sense, although the fact that it does nothing and produces no 
exception or log message is pretty unhelpful. (Bug report!)

To get the button to display the panel, you need to have the window controller 
perform the segue. That means you’ll need a custom window controller subclass 
for the main window, and you can just move the action method into the window 
controller. (Hook the button up to First Responder instead of the view 
controller, too.)

Alternatively, go back to using a segue from the button to open the panel, 
which IIRC was working in an earlier version of this test project. (You posted 
that it wasn’t working, but when I went to look at your project you’d already 
fixed the problem in your project that was preventing it from working. IIRC.)

To do all the combinations of hiding and showing a singleton panel, you’ll 
probably want another custom window controller subclass for the panel itself. 
Not every window/window controller operation seems to be mapped into storyboard 
semantics, so you should expect that there are things that still need to be 
done “the old way”.


Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to arch...@mail-archive.com

Reply via email to