Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NSSplitVIew - auto saving divider positions doesn't work with auto layout enabled

With auto layout enabled, auto saving divider positions by setting an autosave name for the NSSplitView in interface builder results in each divider being completely collapsed on an app restart. Disabling auto layout allows auto save works perfectly.

I have tried this in a new Xcode project as well, same result. Is this a bug, or a known incompatibility?

How could I work around this (or is there a fix to this, if it is a bug)?

like image 765
Jordan Smith Avatar asked May 16 '13 12:05

Jordan Smith


2 Answers

I found that setting Identifier and Autosave within a Storyboard with autolayout enabled doesn't work. However it did work for me once I set the autosaveName programatically.

class MySplitViewController: NSSplitViewController {

    override func viewDidLoad() {
        super.viewDidLoad()            
        splitView.autosaveName = "Please Save Me!"
    }
}

        
like image 68
csch Avatar answered Sep 21 '22 05:09

csch


I ran into this problem as well, and I found that I need to set both the identifier and the autosaveName values for the NSSplitView, and that they need to be set to different values.

like image 13
marcprux Avatar answered Sep 19 '22 05:09

marcprux