I'm using Autolayout & NSSplitViewController to develop a OS X app with two split views. But every time I run the app, the split views have different size. Sometimes it shows:
But sometimes:
What I want is the left panel have a min width of 150 and an initial width of 200. The right panel have a min width of 200 and take the rest space at the initial time.
What I do are followings:
- Add a NSSplitViewController and set it as the window content of the NSWindowController.
- Resize the left panel to the width of 200(which I want to be the initial width, but it seems not working), and add a Table View to it. Then give the table view a min width constrain of 150.
- Add a Custom View to the right panel and give it a min width constrain of 200.
- Set the holding priority of the right splitViewItem to 249.
- Set the view outlet of the SplitViewController to the split view.
Here's my Xcode screenshot: The code are here: https://github.com/luin/sample-NSSplitViewControlller