Questions tagged [nsdocumentcontroller]

An NSDocumentController object manages an application's document.It is available Apple's AppKit framework. This [tag:NSDocumentController] can be tagged with issues related with opening documents etc using NSDocumentController. Available in Mac OS X v10.0 and later.

An NSDocumentController instance is an administrator of a document-based application. It is responsible for servicing user requests to create, open, and save documents. NSDocumentController serves the integral role of the document factory. NSDocument knows how to load a file's contents as the document's data, and NSDocumentController knows how to create NSDocument objects under different circumstances.

From apple Official document:

An NSDocumentController object manages an application’s documents. As the first-responder target of New and Open menu commands, it creates and opens documents and tracks them throughout a session of the application. When opening documents, an NSDocumentController runs and manages the modal Open panel. NSDocumentController objects also maintain and manage the mappings of document types, extensions, and NSDocument subclasses as specified in the CFBundleDocumentTypes property loaded from the information property list (Info.plist).

You can use various NSDocumentController methods to get a list of the current documents, get the current document (which is the document whose window is currently key), get documents based on a given filename or window, and find out about a document’s extension, type, display name, and document class.

Source: NSDocumentController class reference

Related tags:

34 questions
0
votes
0 answers

OS X: open panel does not show icloud documents

I have an app where I want to open panel and user can select a document from local storage or from icloud. I have icloud enabled and also files and data but open panel shows only local storage data. I tried with these functions: NSOpenPanel…
Bartosz Bialecki
  • 4,391
  • 10
  • 42
  • 64
0
votes
2 answers

How to create a new instance of an NSDocument with NSDocumentController?

I tried [[NSDocumentController sharedDocumentController] duplicateDocumentWithContentsOfURL:nil copying:NO …
Colas
  • 3,473
  • 4
  • 29
  • 68
0
votes
1 answer

Preview PDF Document in iOS Before Saving

I am working on building an app that will generate PDFs. I can generate the PDF just fine, but it is a one-click action that builds and saves the PDF. What I would like to do is change it to showing a preview of the PDF and then giving the option…
user717452
  • 33
  • 14
  • 73
  • 149
-1
votes
1 answer

Get NSDocument from NSObject

i am on macOS, objective-c, not iOS. I am currently re-writing my app to be document based. I now save the reuired data in each NSDocument file as property which works great including autosave. I can access that data from NSViewControllers…
Pat_Morita
  • 3,355
  • 3
  • 25
  • 36
1 2
3