Hi
I am trying to create an NSSplitView-based application.
For the sake of modularity, I would like to separate different parts of the
app into several view controllers (each has its own xib).

The problem is when I add a split view as a child view of
NSViewController.view, then load my view controller, and set my main
window's contentView to viewController.view.

All controls show except for NSSplitView.

I tried this multiple times, with different test projects and every time I
get this problem.

It can be easily replicated. Just create a new non-storyboard based cocoa
project, create a new NSViewController subclass, drag an NSSplitView onto
its view into its xib, and in your AppDelegate have the following

@interface AppDelegate ()


@property (weak) IBOutlet NSWindow *window;

@property TestVC *vc;

@end



@implementation AppDelegate


- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

    self.vc = [[TestVC alloc] initWithNibName:@"TestVC" bundle:nil];

    self.window.contentView = self.vc.view;

}


Where TestVC - is the name of your NSViewController's subclass.


What am I doing wrong?


What is interesting - when I do not load the view from a separate xib, but
have the view in MainMenu.xib (even if it is not a subview of the main
window's content view), the split controller shows normally, as expected.


I am using Xcode 7.0.1, OS X ElCapitan 10.11


Thanks for help!
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to