NSDocument Class Reference
PDF
Class at a Glance
Overview
Subclassing NSDocument
Writing of HFS Creator and File Type Codes
NSDocument Saving Behavior
Tasks
Initializing
Loading Document Data
Creating and Managing Window Controllers
Managing Document Windows
Reading From and Writing to Files
Reading From and Writing to URLs
Autosaving
Managing Document Status
Handling User Actions
Closing Documents
Reverting Documents
Printing Documents
Handling Errors
Working with Undo Manager
Managing File Types
Validating User Interface Items
Scripting
Deprecated Methods
Class Methods
isNativeType:
readableTypes
writableTypes
Instance Methods
addWindowController:
autosavedContentsFileURL
autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:
autosavingFileType
canCloseDocument
canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:
close
dataOfType:error:
displayName
fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error:
fileModificationDate
fileNameExtensionForType:saveOperation:
fileNameExtensionWasHiddenInLastRunSavePanel
fileNameFromRunningSavePanelForSaveOperation:
fileType
fileTypeFromLastRunSavePanel
fileURL
fileWrapperOfType:error:
handleCloseScriptCommand:
handlePrintScriptCommand:
handleSaveScriptCommand:
hasUnautosavedChanges
hasUndoManager
init
initForURL:withContentsOfURL:ofType:error:
initWithContentsOfURL:ofType:error:
initWithType:error:
isDocumentEdited
keepBackupFile
lastComponentOfFileName
makeWindowControllers
objectSpecifier
preparePageLayout:
prepareSavePanel:
presentError:
presentError:modalForWindow:delegate:didPresentSelector:contextInfo:
printDocument:
printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo:
printInfo
printOperationWithSettings:error:
readFromData:ofType:error:
readFromFileWrapper:ofType:error:
readFromURL:ofType:error:
removeWindowController:
revertDocumentToSaved:
revertToContentsOfURL:ofType:error:
runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:
runModalPrintOperation:delegate:didRunSelector:contextInfo:
runModalSavePanelForSaveOperation:delegate:didSaveSelector:contextInfo:
runPageLayout:
saveDocument:
saveDocumentAs:
saveDocumentTo:
saveDocumentWithDelegate:didSaveSelector:contextInfo:
saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:
saveToURL:ofType:forSaveOperation:error:
setAutosavedContentsFileURL:
setFileModificationDate:
setFileType:
setFileURL:
setHasUndoManager:
setLastComponentOfFileName:
setPrintInfo:
setUndoManager:
setWindow:
shouldChangePrintInfo:
shouldCloseWindowController:
shouldCloseWindowController:delegate:shouldCloseSelector:contextInfo:
shouldRunSavePanelWithAccessoryView
showWindows
undoManager
updateChangeCount:
validateMenuItem:
validateUserInterfaceItem:
willPresentError:
windowControllerDidLoadNib:
windowControllers
windowControllerWillLoadNib:
windowForSheet
windowNibName
writableTypesForSaveOperation:
writeSafelyToURL:ofType:forSaveOperation:error:
writeToURL:ofType:error:
writeToURL:ofType:forSaveOperation:originalContentsURL:error:
Constants
NSSaveOperationType
NSDocumentChangeType
Appendix A: Deprecated NSDocument Methods
Deprecated in Mac OS X v10.4
dataRepresentationOfType:
fileAttributesToWriteToFile:ofType:saveOperation:
fileName
fileWrapperRepresentationOfType:
initWithContentsOfFile:ofType:
initWithContentsOfURL:ofType:
loadDataRepresentation:ofType:
loadFileWrapperRepresentation:ofType:
printShowingPrintPanel:
readFromFile:ofType:
readFromURL:ofType:
revertToSavedFromFile:ofType:
revertToSavedFromURL:ofType:
runModalPageLayoutWithPrintInfo:
saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:
setFileName:
writeToFile:ofType:
writeToFile:ofType:originalFile:saveOperation:
writeToURL:ofType:
writeWithBackupToFile:ofType:saveOperation:
Revision History
Index
Companion Guide
Document-Based Applications Overview