Reputation: 790
I am a complete noob with Xcode, but I am trying to make a small Mac application. What I want happen, is that I press a button in the main window, and another window opens on top of that main window. As I said, I am a complete noob, so I would prefer a step by step guide :)
Upvotes: 1
Views: 1971
Reputation: 72636
It is quite simple, first of all you have to create a window with Xcode, then a WindowController after that you can link the Controller with your view(the Xib). Then to open up a new window (lets say your window controller is called YourWindowController) just insert this code in the IBAction method that get fired by your button :
YourWindowController *controllerWindow =
[[YourWindowController alloc] initWithWindowNibName:@"You_Window_XIB"];
[controllerWindow showWindow:self];
Upvotes: 2