@Bavarious asnwer is good, people like me always need a good piece of code:
appDelegate = (AppDelegate*)[[NSApplication sharedApplication] delegate]; self.masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil]; [appDelegate.window.contentView replaceSubview:self.view with:self.masterViewController.view];
I am creating an appDelegate object because it is being called from NSViewController , otherwise you might get a view from yourself.
meda
source share