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
1
vote
0 answers

Quickest way to dirty a FileReferenceDocument in SwiftUI for macOS

I have a number of changes to a document-based application which are not undoable (conceptually, think quiz progress) but which should dirty the document so the state is saved when the user quits or closes the document. Apple's documentation for…
green_knight
  • 1,319
  • 14
  • 26
1
vote
1 answer

Use of @StateObject in Document-based SwiftUI application: getting instances instead of references

I am trying to use a @Stateobject in my document as source of truth for the dataModel behind the document. However, it seems I am doing something wrong as I appear to get different instances for the document and the content view, which is in line…
1
vote
0 answers

SwiftUI document-based apps on macOS: How to prevent TextEditor from setting document edited

Problem I am working on a simple SwiftUI document-based app on macOS (12.0.1) with Xcode 13.2.1. In my app, I need two TextEditors in the document view. One displays the content of the document, and the other is used to support some other…
23786
  • 11
  • 3
1
vote
0 answers

NSDocument window controller and outlet instantiation

I have what it seems to be a weird problem with an instance of a document window controller. I have a document-based application with a custom window controller inited from overridden makeWindowControllers method of NSDocument main class: -…
1
vote
1 answer

MVC3 - How to modify action result to get multiple objects update

When I select a theater from a drop down and click on 'add a movie', this code is run. public ActionResult Create(TheaterViewModel input) { var theater = new TheaterViewModel { TheaterId = input.TheaterId, …
ZVenue
  • 4,967
  • 16
  • 61
  • 92
1
vote
0 answers

iOS 14 Document based app adopting SceneDelegate?

I'm recently developing a new document based app. The traditional, and by now, the official template is instantiating an UIDocumentBrowser in the AppDelegate; and the official recommendation for document based app to use the document browser as the…
zrfrank
  • 2,631
  • 1
  • 12
  • 18
1
vote
0 answers

How to Implement Intermediate File Type for Document-Based Applications like QuickTime Player?

Does anyone here have experience with document-based applications on macOS in which you can make a document file type that the user can't save via the app? Having the rename/move dropdown with disabled name and location fields? Wanted to start with…
Kyler S.
  • 11
  • 2
1
vote
0 answers

Understanding Core Data in Document Based App

I'm creating a document based app, using swift / SwiftUI and core data for the first time. My approach for CRUDing works - but it doesn't seem to be "right" somehow. Maybe there is a more elegant way of doing this. In my Document-Class I get my…
1
vote
1 answer

How do I connect SwiftUI to a Document in a macOS Document-based app?

I’m trying to create a basic Document-Based SwiftUI app. However, the skeleton created by Xcode does not have any linkage between the document and the content view. Here is what I have inferred to be the correct way: struct Task { var done: Bool …
sfiera
  • 109
  • 6
1
vote
1 answer

When Application quits, NSDocument's isDocumentEdited method always returns false

In a document-based application, any change in a document is signalled by a [self updateChangeCount: NSChangeDone]; At any time, when debugging, the [document isEdited] returns TRUE, as far as the document has been edited. The doc's window displays…
Denis
  • 775
  • 7
  • 22
1
vote
1 answer

How to add simple save-load functions to document-based Swift 3 app?

I'm studying Swift (for just a hobby) at the moment, and trying to figure out how I'm supposed to and save and load functions to document.swift file in document-based swift app? I'd like to know how to save and load simple txt-files. I'm using…
paha
  • 11
  • 3
1
vote
0 answers

Document not deallocated on window close?

I have a document-based application, and my NSDocument subclass and NSWindow subclass are not being deallocated when I close a window. Any idea how to fix this?
user1007895
  • 3,925
  • 11
  • 41
  • 63
1
vote
0 answers

When is NSDocumentController instance instantiated by default in a Document-Based template project?

I created a Document based Cocoa project in Xocode 8.0 on maxOS 10.11.6, using swift 3.0.1. I deleted the mainMenu.xib, document.xib, modified the infolist, and then added my own main function. Becasue I do not use Interface Builder at all. In the…
1
vote
3 answers

cocoa document based application with shared windows?

I'm developing a document based app. Each document has three windows (and hence three window controllers). I'd like to set it up so that two of the three windows are shared between different open documents (swapping views as needed). Is this…
Kevin Gross
  • 121
  • 1
  • 7
1
vote
1 answer

Disable Document-Based functionality on a Cocoa Application

I started a Document-Based project on XCode for a MacOS project. I realize now that i don't need this functionality and its potentially causing problems and delays in my progress. Is there a way to disable this functionality?
Jacobo Koenig
  • 11,728
  • 9
  • 40
  • 75