Allow unmovable singleton document-based apps

Originator:martin.j.nash
Number:rdar://20389552 Date Originated:April 1, 2015
Status:Open Resolved:
Product:OS X SDK Product Version:
Classification:Enhancement Reproducible:Always
 
Summary:
There should be a way to create a document-based app that has a single document in a known location within the apps sandbox. There should be a way to prevent the NSWindow from displaying a NSWindowButton.DocumentVersionsButton (NSWindowDocumentVersionsButton)

There are two ways to hide the document version button
 
1: Turning off autosving from the Document by returning false from `class func autosavesInPlace() -> Bool`. This is not a good option, because we lose the benefits of autosaving.

2: Subclassing NSWindow and overriding standardWindowButton:forStyleMask: class and instance methods to return nil for NSWindowButton.DocumentVersionsButton. This is not a good option because I have been informed that NSWindow is not guaranteed to access the NSWindowDocumentVersionsButton via these methods.

Steps to Reproduce:
1. Create a document based app
2. Subclass NSWindow and override methods to return nil for NSWindowDocumentVersionsButton

-- OR --

2. Return false from autosavesInPlace() in a subclass of NSDocument

Expected Results:
There should be a recommended way to have a 'singleton' document-based application.



Attachments:
'SingleDocumentExample.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!