Search code examples
xcodemacoscocoanswindownspanel

Switching NSWindows


I have two NSWindows, both with an NSPanel in them. I want to switch windows when a button is pressed. How can this be done? I don't need the old window any more so I just want to show the new one.


Solution

  • To focus the second window, simply call:

    [window2 makeKeyWindow];