objective-cmacosswiftnsviewnssplitview

Starting Position of NSSplitView divider


How can I set the start position of a NSSplitView?

The closest thing I've found that looks like it would work is setPosition

//Set splitView position.
[splitView setPosition:330 ofDividerAtIndex:0];

This doesn't seem to do anything though, my splitview still starts with the divider in the center.

ANy ideas?


Solution

  • Maybe that is the center? If splitView is correctly hooked up to your split view, that code should work. You should probably log [splitView minPossiblePositionOfDividerAtIndex:0] and [splitView maxPossiblePositionOfDividerAtIndex:0] before trying to set the position of the divider so you know the possible values.