开发者

Setting view in NSSplitView not working

开发者 https://www.devze.com 2023-03-07 23:44 出处:网络
Please excuse my ignorance, I\'m coming from iOS to Mac programming. I have two nibs. One is the main windo开发者_C百科w with the split view. The nib contains a navigationController view I created. I\

Please excuse my ignorance, I'm coming from iOS to Mac programming. I have two nibs. One is the main windo开发者_C百科w with the split view. The nib contains a navigationController view I created. I'm trying to replace the right pane of the split view (navigationView) with this view. When the application first launches, navigationView is just a custom view in interface builder.

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    NavigationController *navController = [[NavigationController alloc]
                                           initWithNibName:@"NavigationController" 
                                           bundle:[NSBundle mainBundle]];
    navigationView = navController.view;
}

This doesn't seem to do anything. I tried adding the navController.view as a subview, and that at least gets it showing up, but it is placed very oddly. Any suggestions? Thanks!


You will definitely have to add the views you want in the NSSplitView as a subviews of the NSSplitView. You'll need to provide more information about what happens after that.

There's lots of sample code on Apple's website and many of them use NSSplitViews.

0

精彩评论

暂无评论...
验证码 换一张
取 消