• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSplitView in a separate NSWindowControl doesn't show for some reason
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSplitView in a separate NSWindowControl doesn't show for some reason


  • Subject: NSSplitView in a separate NSWindowControl doesn't show for some reason
  • From: Nick <email@hidden>
  • Date: Sat, 24 Oct 2015 21:51:53 +0300

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 (email@hidden)

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:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSSplitView in a separate NSWindowControl doesn't show for some reason
      • From: Graham Cox <email@hidden>
    • Re: NSSplitView in a separate NSWindowControl doesn't show for some reason
      • From: Nick <email@hidden>
  • Prev by Date: Re: Hide UINavigationBar and keep UIPageController content static
  • Next by Date: Updated View Bounds After Orientation Change...
  • Previous by thread: Just a little off topic update.
  • Next by thread: Re: NSSplitView in a separate NSWindowControl doesn't show for some reason
  • Index(es):
    • Date
    • Thread