# NSDocument

Carl.Lindberg@hbo.com
Generated at 2026-06-27 19:09:52 +0000

The abstract document class

1999 Free Software Foundation, Inc.
Software documentation for the NSDocument class
AppKit/NSDocument.h
Description forthcoming.
isNativeType:
type
Description forthcoming.
readableTypes
Description forthcoming.
writableTypes
Description forthcoming.
addWindowController:
windowController
Description forthcoming.
autosaveDocumentWithDelegate:
delegate
didAutosaveSelector:
didAutosaveSelector
contextInfo:
context
Description forthcoming.
autosavedContentsFileURL
Description forthcoming.
autosavingFileType
Description forthcoming.
canCloseDocument
Description forthcoming.
canCloseDocumentWithDelegate:
delegate
shouldCloseSelector:
shouldCloseSelector
contextInfo:
contextInfo
Description forthcoming.
close
Closes all the windows owned by the document, then removes itself from the list of documents known by the NSDocumentController. This method does not ask the user if they want to save the document before closing. It is closed without saving any information.
dataOfType:
type
error:
error
Description forthcoming.
dataRepresentationOfType:
type
Description forthcoming.
displayName
Description forthcoming.
fileAttributesToWriteToFile:
fullDocumentPath
ofType:
docType
saveOperation:
saveOperationType
Description forthcoming.
fileAttributesToWriteToURL:
url
ofType:
type
forSaveOperation:
op
originalContentsURL:
original
error:
error
Description forthcoming.
fileModificationDate
Description forthcoming.
fileName
Description forthcoming.
fileNameExtensionForType:
typeName
saveOperation:
saveOperation
Description forthcoming.
fileNameExtensionWasHiddenInLastRunSavePanel
Description forthcoming.
fileNameFromRunningSavePanelForSaveOperation:
saveOperation
Description forthcoming.
fileType
Description forthcoming.
fileTypeFromLastRunSavePanel
Description forthcoming.
fileURL
Description forthcoming.
fileWrapperOfType:
type
error:
error
Description forthcoming.
fileWrapperRepresentationOfType:
type
Description forthcoming.
hasUnautosavedChanges
Description forthcoming.
hasUndoManager
Description forthcoming.
init
Description forthcoming.
initForURL:
forUrl
withContentsOfURL:
url
ofType:
type
error:
error
Description forthcoming.
initWithContentsOfFile:
fileName
ofType:
fileType
Initialises the receiver with the contents of the document at fileName assuming that the type of data is as specified by fileType.
Destroys the receiver and returns `nil` on failure.
initWithContentsOfURL:
url
ofType:
fileType
Initialises the receiver with the contents of the document at url assuming that the type of data is as specified by fileType.
Destroys the receiver and returns `nil` on failure.
initWithContentsOfURL:
url
ofType:
type
error:
error
Description forthcoming.
initWithType:
type
error:
error
Description forthcoming.
isDocumentEdited
Description forthcoming.
keepBackupFile
Description forthcoming.
lastComponentOfFileName
Description forthcoming.
loadDataRepresentation:
data
ofType:
type
Description forthcoming.
loadFileWrapperRepresentation:
wrapper
ofType:
type
Description forthcoming.
makeWindowControllers
Creates the window controllers for the current document. Calls addWindowController: on the receiver to add them to the controller array.
preparePageLayout:
pageLayout
Description forthcoming.
prepareSavePanel:
savePanel
Description forthcoming.
presentError:
error
Description forthcoming.
presentError:
error
modalForWindow:
window
delegate:
delegate
didPresentSelector:
sel
contextInfo:
context
Description forthcoming.
printDocument:
sender
Description forthcoming.
printDocumentWithSettings:
settings
showPrintPanel:
flag
delegate:
delegate
didPrintSelector:
sel
contextInfo:
context
Description forthcoming.
printInfo
Description forthcoming.
printOperationWithSettings:
settings
error:
error
Description forthcoming.
printShowingPrintPanel:
flag
Description forthcoming.
readFromData:
data
ofType:
type
error:
error
Description forthcoming.
readFromFile:
fileName
ofType:
type
Description forthcoming.
readFromFileWrapper:
wrapper
ofType:
type
error:
error
Description forthcoming.
readFromURL:
url
ofType:
type
Description forthcoming.
readFromURL:
url
ofType:
type
error:
error
Description forthcoming.
removeWindowController:
windowController
Description forthcoming.
revertDocumentToSaved:
sender
Description forthcoming.
revertToContentsOfURL:
url
ofType:
type
error:
error
Description forthcoming.
revertToSavedFromFile:
fileName
ofType:
type
Description forthcoming.
revertToSavedFromURL:
url
ofType:
type
Description forthcoming.
runModalPageLayoutWithPrintInfo:
printInfo
Description forthcoming.
runModalPageLayoutWithPrintInfo:
info
delegate:
delegate
didRunSelector:
sel
contextInfo:
context
Description forthcoming.
runModalPrintOperation:
op
delegate:
delegate
didRunSelector:
sel
contextInfo:
context
Description forthcoming.
runModalSavePanel:
savePanel
withAccessoryView:
accessoryView
Description forthcoming.
runModalSavePanelForSaveOperation:
saveOperation
delegate:
delegate
didSaveSelector:
didSaveSelector
contextInfo:
contextInfo
Description forthcoming.
runPageLayout:
sender
Description forthcoming.
saveDocument:
sender
Description forthcoming.
saveDocumentAs:
sender
Description forthcoming.
saveDocumentTo:
sender
Description forthcoming.
saveDocumentWithDelegate:
delegate
didSaveSelector:
didSaveSelector
contextInfo:
contextInfo
Description forthcoming.
saveToFile:
fileName
saveOperation:
saveOperation
delegate:
delegate
didSaveSelector:
didSaveSelector
contextInfo:
contextInfo
Description forthcoming.
saveToURL:
url
ofType:
type
forSaveOperation:
op
delegate:
delegate
didSaveSelector:
didSaveSelector
contextInfo:
contextInfo
Description forthcoming.
saveToURL:
url
ofType:
type
forSaveOperation:
op
error:
error
Description forthcoming.
setAutosavedContentsFileURL:
url
Description forthcoming.
setFileModificationDate:
date
Description forthcoming.
setFileName:
fileName
Description forthcoming.
setFileType:
type
Description forthcoming.
setFileURL:
url
Description forthcoming.
setHasUndoManager:
flag
Description forthcoming.
setLastComponentOfFileName:
str
Description forthcoming.
setPrintInfo:
printInfo
Description forthcoming.
setUndoManager:
undoManager
Description forthcoming.
setWindow:
aWindow
Description forthcoming.
shouldChangePrintInfo:
newPrintInfo
Description forthcoming.
shouldCloseWindowController:
windowController
Description forthcoming.
shouldCloseWindowController:
windowController
delegate:
delegate
shouldCloseSelector:
callback
contextInfo:
contextInfo
Description forthcoming.
shouldRunSavePanelWithAccessoryView
Description forthcoming.
showWindows
Makes all the documents windows visible by ordering them to the front and making them main or key.
If the document has no windows, this method has no effect.
undoManager
Description forthcoming.
updateChangeCount:
change
Description forthcoming.
validateMenuItem:
anItem
Description forthcoming.
validateUserInterfaceItem:
anItem
Description forthcoming.
willPresentError:
error
Description forthcoming.
windowControllerDidLoadNib:
windowController
Description forthcoming.
windowControllerWillLoadNib:
windowController
Description forthcoming.
windowControllers
Description forthcoming.
windowForSheet
Description forthcoming.
windowNibName
Description forthcoming.
writableTypesForSaveOperation:
op
Description forthcoming.
writeSafelyToURL:
url
ofType:
type
forSaveOperation:
op
error:
error
Description forthcoming.
writeToFile:
fileName
ofType:
type
Description forthcoming.
writeToFile:
fileName
ofType:
type
originalFile:
origFileName
saveOperation:
saveOp
Description forthcoming.
writeToURL:
url
ofType:
type
Description forthcoming.
writeToURL:
url
ofType:
type
error:
error
Description forthcoming.
writeToURL:
url
ofType:
type
forSaveOperation:
op
originalContentsURL:
orig
error:
error
Description forthcoming.
writeWithBackupToFile:
fileName
ofType:
fileType
saveOperation:
saveOp
Description forthcoming.