I'm really new to Mac development (although I have lots of iOS experience) and I'm trying to switch between NSViewControllers in a NSWindow. It's really simple: when a button is pressed, show the second view and hide the first one. Here's my code:
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
firstView = [[FirstView alloc] initWithNibName:@"FirstView" bundle:nil];
[_window setContentView:menu.view];
}
- (IBAction)openSecondView:(id)sender {
secondView = [[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
[_window setContentView:game.view];
}
I made sure that the method is called, and that secondView is loaded correctly. What's the problem here?