Search code examples
objective-cxcodecocoainterface-buildernssplitview

NSSplitViewItem does not display like it designed in IB


I created a new empty Xcode project. And just added a NSSplitViewController to storyboard like below.

enter image description here

And I ran the application, found out that the main window looked like below.

enter image description here

The left split view was collapsed by default. I hoped it should be displayed like below:

enter image description here

And I was not set both split view item's collapsed property in Xcode.

Any one could help me to figure out what's wrong with my app?

Thank you very much for any help.


Solution

  • Try connecting the view outlet of the NSSplitViewController to the NSSplitView - this worked for me in a simple sample project. enter image description here

    If no-one comes along with a better answer, I'd consider filing this behaviour as a bug using Apple's Bug Reporter - either this connection should be configured by default, or it shouldn't be needed at all.