Sunday, 1 September 2013

How to set viewcontroller as rootview in cocoa?

How to set viewcontroller as rootview in cocoa?

I am very new to cocoa application this question may be asked or
something, My question is i have appdelegate and mainwindow.xib i created
another view controller and called from appdelegate and it is running
good. Now my doubt is whether its possible to make the view controller as
root with out adding it to main window.xib. Whether its must to load our
view with mainwindow.xib?
am calling view controller like this
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
self.view = [[ViewController alloc] initWithNibName:@"ViewController"
bundle:nil];
[self.window.contentView addSubview:self.view.view];
self.view.view.frame = ((NSView*)self.window.contentView).bounds;
}

No comments:

Post a Comment