• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Triggering a segue from code
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Triggering a segue from code


  • Subject: Triggering a segue from code
  • From: "email@hidden" <email@hidden>
  • Date: Sun, 18 Sep 2016 15:22:52 -0400

For reference, I have a sample project location at

https://github.com/ericgorr/nspanel_show

It is a Document Based and Storyboard application.

On my main window, I have a toolbar with an Toolbar Item called 'Inspector'. I have defined a segue between this item and my Inspector Utility Panel called "Show Inspector". When I press the Inspector toolbar item, the utility panel does show as expected. I can close the panel by pushing the standard window close button.

What I would like to do is trigger my "Show Inspector" segue when I push the "Show Panel" button. I have tried the code:

    @IBAction func showMyPanel( _ sender: AnyObject )
    {
        NSLog( "How do I show the panel?" )

        self.performSegue( withIdentifier: "Show Inspector", sender: self )

    }

While I do see the log message 'How do I..', my utility panel is not shown.

How can I get this work?

Here is an image that shows the basic setup in Interface Builder.

https://github.com/ericgorr/nspanel_show/blob/master/extra/Screen Shot 2016-09-17 at 8.13.23 PM.png


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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 email@hidden


  • Follow-Ups:
    • Re: Triggering a segue from code
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Strange toolbar item error
  • Next by Date: Re: Triggering a segue from code
  • Previous by thread: Re: How to make Xcode launch a different app when "Running" my code?
  • Next by thread: Re: Triggering a segue from code
  • Index(es):
    • Date
    • Thread