Questions tagged [document-based]

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.

112 questions
5
votes
5 answers

Having Trouble Getting the UIDocumentBrowserController to open docs in a Document based app

I've been working on a new Document-based app, and was super glad about the new UIDocumentBrowserController...trying to roll my own solution for the document browser UI was tricky! I'm having some trouble getting the browser to open documents after…
5
votes
2 answers

Core Data Document-Based Application with Global Persistent Store

I've got a document-based Core Data application which works as is. I would like to add support for a global persistent store to hold a library of items. I've read most of the relevant docs, and understand that I should use configurations in the…
Dalmazio
  • 1,835
  • 2
  • 23
  • 40
5
votes
1 answer

How do I create icon for my documents in OS X

I have a document-based application. So I need an icon for my app as well as an icon for my documents. In Xcode/Images.xcassets there is an item called AppIcon which I can use for setting the icon of the app. But how do I make an icon for my…
Bob Ueland
  • 1,804
  • 1
  • 15
  • 24
5
votes
2 answers

Prevent save prompt when closing NSWindow

I have a document-based Cocoa app that uses a secondary NSWindow for a preview mode (with shouldCloseDocument set to NO). If the document is dirty (edited without saving) and I close the secondary NSWindow, a "Do you want to save the changes made to…
hpique
  • 119,096
  • 131
  • 338
  • 476
4
votes
0 answers

What is the connection between NSDocumentController and the app delegate?

I'm trying to understand the structure of a Cocoa document based application. I understand that the app delegate responds to events from the application (hence its name) and that the document controller manages all documents and open and save etc.…
4
votes
1 answer

Document-Based App with Swift

Can someone please tell me how to fix the Apple Template in Xcode 6 for a document-based app with Swift. I've tried with and without core data(prefer with), with storyboards instead of regular Xibs. The standard, out of the box template returns a…
Stephen Donnell
  • 810
  • 9
  • 20
3
votes
1 answer

Is there a better way to access the Document from its subviews?

I have some classes located on my Document such as NSNotificationCenter and NSUndoManager that I need access to from my subviews. Right now I can access them by doing something like this: NSUndoManager *undoManager = [[[[[self view] window]…
panupan
  • 1,212
  • 13
  • 15
3
votes
2 answers

Can Xcode Document-based app be set to always open in a new tab

I have an macOS xcode swiftui document-based app. I can see that if I, "view->show tab bar" in the app, I get multiple tabs for free. However, if I do a "file open ...", it creates a new window. Now I eventually found that holding down option…
altimes
  • 380
  • 2
  • 13
3
votes
0 answers

How can I change the filename in a SwiftUI Document-based app?

I've been using the new template for a document-based SwiftUI app. While you get a lot of file-management "for free" in the new template, as it stands in the iOS version users have to back out of the file to the file browser to change the filename.…
Steven Hovater
  • 1,389
  • 2
  • 12
  • 25
3
votes
0 answers

OSStatus error -4

I am creating document based app and I have strange problem - I can't open files which I saved. Each time I receive this error: "The document /name/ could not be opened". Here is output from NSError: The operation couldn’t be completed. (OSStatus…
Gun13
  • 103
  • 9
3
votes
2 answers

Cocoa document-based application with multiple document types

I want to build a document-based app in Cocoa but so that it can create and handle different types of documents. Think Word, Excel, Powerpoint all in one application, only much simpler. But every window will be different based on the type of…
ron
  • 31
  • 1
  • 2
2
votes
1 answer

In a document based cocoa app, who's in charge?

According to the Document-Based Applications Guide, there should be a DocumentController, a Document, and a WindowController. What I am having trouble with is learning to judge where a given responsibility ought to fall. My Document represents a…
Ziggy
  • 21,845
  • 28
  • 75
  • 104
2
votes
5 answers

Get URL from Open dialog of standard Swift document-based application

I am trying to extract the URL of the document a user has selected in the default "Open" dialogue of my document based macOS application. I understand, a fileWrapper is passed to the init method but is there a way of extracting the path/URL from…
2
votes
0 answers

Store Drawings of PKCanvasView in file

I created a document based app with SwiftUI and a PKCanvasView. Now I want to save the drawings of the PKCanvasView inside of the file. How can I do this?
2
votes
1 answer

UIDocumentBrowser doesn’t work on iPads while works fine on a simulator [iOS, Swift]

I am learning about how to build a document-based app in iOS. I followed Apple's official example (https://developer.apple.com/documentation/uikit/view_controllers/building_a_document_browser-based_app#overview) and tried to revise it to display a…
user8460166
  • 73
  • 1
  • 6
  • 24