Search code examples
macoscocoanswindownsmenu

Prevent NSMenu from creating multiple instances of same NSWindow when clicked


I have a simple Cocoa Application that launches a NSWindow when an NSMenu item is clicked. I am initiating the window via a segue. The problem is when I click the menu item multiple times it keeps creating new windows instead of bringing the existing window to the foreground. How can I prevent this behavior? Thanks in advance.


Solution

    1. Select destination window controller
    2. Click attribute inspector and select under Presentation "Single" instead of "Multiple"

    Single window instance