Search code examples
macoscocoaosx-elcapitannsopenpanel

NSOpenPanel is not able to add accessoryView in El Capitan(10.11)


I have noticed a strange problem in El Capitan(10.11) - I am not able to add an accessoryView to NSOpenPanel.

It was OK for Mavericks(10.9) and Yosemite(10.10). Is there anything changed in 10.11?

Here is simple code:

        let openPanel = NSOpenPanel()
        openPanel.delegate = self
        openPanel.title = "Choose a vbo file"
        openPanel.showsResizeIndicator = true
        openPanel.showsHiddenFiles = false
        openPanel.canChooseDirectories = false
        openPanel.canCreateDirectories = true
        openPanel.allowsMultipleSelection = false

        //RLFileWizardView is just custom view
        let subview = RLFileWizardView(frame: NSRect(x: 0,y: 0,width: 800,height: 300))
        openPanel.accessoryView = subview

Any Ideas?


Solution

  • A new property has been added to NSOpenPanel:

    /* Gets and sets the disclosure state of an accessory view in an NSOpenPanel. If hiding / disclosing an accessory view is not applicable this property will behave like a read only property. */

    @property (getter=isAccessoryViewDisclosed) BOOL accessoryViewDisclosed;

    If set accessoryViewDisclosed to true, it shows accessory view again.