I am writing a multi-document application for macOS Swift. I'm starting with the Document app template provided by Xcode. It's unclear whether it’s an object model or not. Is NSDocument the model or is the data contained therein the model?
Is NSDocument subclass a model object or not?
211 views Asked by ATL_DEV At
2
There are 2 answers
0
VoodooBoot
On
According to Apple, no, NSDocument is not a model. See the following diagram from Apple's Developing a Document-Based App. Notice that both the NSDocument and the UI (contentViewController, an NSViewController) access the model.
Related Questions in SWIFT
- Navigate after logged in with webservice
- URLSession requesting JSON array from server not working
- When using onDrag in SwiftUI on Mac how can I detect when the dragged object has been released anywhere?
- Protect OpenAI key using Firebase function
- How to correct error: "Cannot convert value of type 'MyType.Type' to expected argument type 'Binding<MyType>'"?
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Using @Bindable with a Observable type in SwiftUI
- How to make a scroll view of 9 images in a forEach loop open on image 6 if image 6 is clicked on from a grid?
- Using MTLPixelFormat.rgba16Float results in random round-off errors
- Search and highlight text of current text in PDFKit Swift
- How is passing a function as a parameter related to escaping autoclosure?
- Actionable notification api call not working in background
- Custom layout occupies all horizontal space
- Is it possible to fix slow CKAsset loading on Cloudkit?
- Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value - MapView.isMyLocationEnabled
Related Questions in COCOA
- In what context can we use an unqualified #selector() expression in Swift?
- How can I trigger macOS system gamepad API based on a value received from iOS app through core bluetooth
- Using sort descriptors in Outline View
- NSTableView to NSOutlineView Drag & Drop not accepting drop
- How to remove horizontal line in bottom of section NSTableView?
- CGSRegionRef: How is an arbitrary region represented as union of rects?
- Listen for Touch Events on MacOS (Trackpad)
- Window "yanks" when moving
- Writing NSFilePromiseProviders to pasteboard blocks app on quit
- Basic ImGui program doesn't render, leaks memory and crashes
- NSTokenField suggestion using context menu in swift
- How to link multiple text views to a single text storage in TextKit 2
- I would like to know why I’m not getting IBOutlets connected in an App’s window
- How to make a custom event loop in Cocoa?
- Why is restoreWindow(withIdentifier:state:) called after applicationDidFinishLaunching(_:)?
Related Questions in MODEL
- Can raw means and estimated marginal means be the same ? And when?
- Can't load the saved model in PyTorch
- Question answering model for determine TRL(Technology Readiness Levels)
- Cannot trace my own model using torch.jit.trace
- Get json field value in sqlite model from view django
- Loading the pre-trained model from the .h5 file (Works on Colab but does not work on Local)
- how to get a model in js for odoo 16
- Is there a way to connect two models in mern and access user id of other model
- Using service in the constructor of a MODEL (angular)
- Beta coefficient of direct effect increases after controlling for mediator
- Running a pretrained model on real-time applications
- How to create two separate sets of data (one for daylight hours and another for nighttime hours) from hourly netcdf model output using CDO
- How to understand the Sensor Setting Property ID in the SIG Mesh model
- ValueError: Unknown layer: 'Custom>TFMPNetMainLayer'
- How to generate thumbnail images or GIFs from .GLB 3D models in Python?
Related Questions in NSDOCUMENT
- Autosaving NSDocument memory leak with NSWindow and NSToolbar - NSDocumentTitlebarPopoverViewController leaks
- macOS document based app - save all documents as one
- Implementing NSDocument in a right way
- Make "Close All" (cmd+option+W) apply only to one type of document windows
- iCloud Drive: NSDocument.revert(toContentsOf:ofType:) called when document is merely opened on another device
- NSDocument XML read Issue
- displayName won't set despite allowing set
- How to find out if print panel was closed successfully when printing from a PDFView
- `NSDocument`'s `data(ofType:)` getting data from (async) `actor`
- Is NSDocument subclass a model object or not?
- NSDocument-Based Application: Selecting Default File Type in NSSavePanel
- Changing NSDocument tab names. (Swift)
- NSDocument file wrapper sync via iCloud doesn't appear to support editing on multiple computers simultaneously
- Get NSDocument from NSObject
- Document based app using one single window
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Apple says that a “document’s data is called the data model”:
This
NSDocumentsubclass importsCocoaand is deeply entangled with UI layer code, so one would be hard-pressed to call a true model object (though it is a useful abstraction). Many of us strive to keep true “model” objects free of UI/OS dependencies.In short, the data managed by the
NSDocumentis more aptly considered the “model”.