NSSplitview autosave broken in 10.11.2 beta

My application uses a NSSplitViewController to which I add NSSplitViewItems after NIB load. I have three items and want the third to be collapsed by default. I also want new windows to restore the split view to an autosaved configuration.


What works fine on Yosemite: Create and add the items in viewDidLoad of my NSSplitViewController subclass. On the third item I set .collapsed = YES. I set the autosaveName on NSSplitView once all items are added.


The split view loads with the default configuration: 2 items visible, 1 collapses. If an autosave configuration exists, it is applied.


Running the same binary on El Capitan, this works only for items that are not collapsed by default. The third item where .collapsed = YES is always collapsed.


Example:


  NSSplitViewItem *previewSplitViewItem = [NSSplitViewItem splitViewItemWithViewController:previewViewController];
  previewSplitViewItem.holdingPriority = 270;
  previewSplitViewItem.canCollapse = YES;
  previewSplitViewItem.collapsed = YES;

  [self addSplitViewItem:previewSplitViewItem];

  [self.splitView setAutosaveName:@"Document Split View"];


When compiled against 10.10 SDK and run on 10.10, previewSplitViewItem is collapsed or not according to user defaults saved under "NSSplitView Subview Frames Document Split View". Running the same binary on 10.11.2 beta, previewSplitViewItem is always collapsed.

Replies

If you haven't already, please file a bug with a test app that shows the problem.

I just added a sample project to Radar 23292836


https://dl.dropboxusercontent.com/u/2381634/RADAR/NSSplitViewTest.zip

Yes, please do file a radar with a sample app.

I tried reproducing this in my own sample app, but saw that collapsed was being restored as expected.


Also, do you know if this behaved correctly in your case on 10.11.0 or 10.11.1?

Radar is 23292836.


I don't have 10.11.0 or 10.11.1. I had a friend test on 10.11.1. NSSplitView autosave worked as expected. The bug appears to be new in 10.11.2

Had somebody else test on the release version of El Capitan. The bug exists there too.