Document-based application design enables users to create and manage documents containing their data. In cocoa, this is enabled via the "document architecture" subsystem which provides inbuilt support for applications that manage documents.
Questions tagged [document-based]
112 questions
2
votes
2 answers
Single Document Interface document based cocoa application
Is there a way to create Single Document Interface (SDI) document based cocoa application?
I dont want user to open multiple documents at once.

fish potato
- 5,319
- 6
- 27
- 32
2
votes
2 answers
MacOS Application can't reopen autosaved files
I'm building a MacOS SwiftUI Document-Based App where I defined a new Exported Type Identifier with a new extension and all of that.
In the beginning, I didn't care about the Type Identifier so I named it com.example.Dapka.dap, but later on, I tried…

Adam M.
- 85
- 10
2
votes
1 answer
How do I save multiple files in a package folder from a SwiftUI Document Based App?
I'm developing a SwiftUI document-based app that contains some easily serializable data plus multiple images. I'd like to save the document as a package (i.e, a folder) with one file containing the easily serialized data and a subfolder containing…

tdl
- 297
- 3
- 11
2
votes
0 answers
NSDocumentController noteNewRecentDocumentURL(_:) equivalent for MacCatalyst
I recently built an app with UIKit for iOS, iPadOS and macOS.
This app opens files (it's a code editor). When a file is opened from Finder, it appears in the recent menu, but when a file is opened from the app menu, it does not.
I wanted to use…

Nathan Fallet
- 321
- 2
- 16
2
votes
0 answers
What is happening in the App launching sequence of SwiftUI Document Based App?: File picker dialog shown automatically
I'm creating test Document based app with Xcode 11 and SwiftUI.
At first, I have thought that I have to add file picker dialog and open menu/button to my app. But it need not. The file picker dialog was shown automatically when the app…

shuna
- 307
- 1
- 7
2
votes
1 answer
Core Data document-based app: saves, but cannot load
So long story short, I'm working on a Cocoa CoreData Document-Based app (my first time working with Cocoa), I haven't written a single line of code, everything is done through bindings and the default code and everything works great, I can enter…

0zymandias
- 41
- 1
2
votes
1 answer
Document-Based Application
Xcode 9 / iOS 11:
My app creates pdf-files which are rendered with data from a core data-database. The pdf's are created from a WebView and are stored in the documents directory. Everything works so far. I can open the pdf-files in Apple's Files App…

fario
- 23
- 5
2
votes
1 answer
Do macOS Document-Based Apps Automatically Enable Collaboration?
I am looking to build a document-based app on macOS using Xcode and targeting macOS High Sierra.
Does NSDocument provide document collaboration similar to that of Pages? Apple's Document Based Apps page suggests that collaboration is a feature of…

Jake3231
- 703
- 8
- 22
2
votes
2 answers
OS X App Sandboxing and arbitrary files access - Update to Document-based?
My OS X app (currently not sandboxed) accesses files contained inside a directory set by the user (one chooses the path with a NSOpenPanel and a reference to this path is kept throughout execution). The list of files is generated via…

beeb
- 1,187
- 11
- 32
2
votes
2 answers
Can't change stringValue from label in Document class (Document based application, Mac)
I'm creating a 'test' document based application to learn more about how they work. I want to load an array that I saved earlier.
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError
{
NSString *string =…

Developer
- 406
- 1
- 4
- 18
2
votes
2 answers
Disable Open Panel in Cocoa Document Based App Launch
I have written a document based application which has disabled auto-creation of new documents when the app launches without restoring a previously opened document.
Now I would also like to disable the open panel that appears on app launch.
The open…

xizor
- 1,554
- 2
- 16
- 35
2
votes
0 answers
Incorporate document features into shoebox app
I'm working on a shoebox (library style) app for Mac OS X which will incorporate a page view like in Apple's text edit sample code.
Since this is a shoebox app, I cannot simply generate a document-based Xcode project because I want the user to…

user3932488
- 139
- 1
- 9
2
votes
2 answers
Check if NSDocument is new
How do you know if a NSDocument is new?
I'm currently using fileURL != nil but I couldn't find any place in the documentation that confirms this.
Also, fileURL returns nil in restored documents (after quitting the app without saving and then opening…

hpique
- 119,096
- 131
- 338
- 476
1
vote
1 answer
NSWindowRestoration issue
I am having a difficult time implementing this new "feature" of Mac OS X 10.7. For the most part, my application works without my having to do anything. Files reopen on launch as expected. If the file is deleted however, my application opens to…

Scott Henderson
- 101
- 11
1
vote
1 answer
DocumentData / DocumentGroup initializes new instance of @ObservedObject on each change of the documents data in swift
I'm trying to create a Document-Based App, where each new Document has an own instance of Session(), which should not be stored with the document data though:
DocumentGroup(newDocument: DocumentData()) { file in
ContentView(document:…

JacquesNorris
- 93
- 7