Name

NSDocumentController — Mac OS X 10.0

Synopsis

NSDocumentController is one of three classes that make up the document-based application architecture. The other two classes are NSDocument and NSWindowController. This class is responsible for managing an applications documents, in particular providing an implementation for the File Open and File New commands. Additionally, NSDocumentController takes responsibility for ensuring that documents are properly saved and closed before an application terminates.

image with no caption

@interface NSDocumentController : NSObject <NSCoding>
                                  // Initializers
   - (id)init;
                                  // Accessor Methods
   - (void)setShouldCreateUI:(BOOL)flag;
   - (BOOL)shouldCreateUI;
                                  // Class Methods
   + (id)sharedDocumentController;
                                  // Instance Methods
   - (BOOL)closeAllDocuments;
   - (NSArray *)URLsFromRunningOpenPanel;
   - (void)addDocument:(NSDocument *)document;
   - (IBAction)clearRecentDocuments:(id)sender;
   - (void)closeAllDocumentsWithDelegate:(id)delegate 
                                 didCloseAllSelector:(SEL)didAllCloseSelector
                                 contextInfo:(void *)contextInfo;
   - (NSString *)currentDirectory;
   - (id)currentDocument;
   - (NSString *)displayNameForType:(NSString *)documentTypeName;
   - (Class)documentClassForType:(NSString *)documentTypeName;
   - (id)documentForFileName:(NSString *)fileName;
   - (id)documentForWindow:(NSWindow *)window;
   - (NSArray *)documents;
   - (NSArray *)fileExtensionsFromType ...

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.