<!--
{
  "documentType" : "article",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/nsdocument-deprecated-symbols",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Deprecated Symbols"
}
-->

# Deprecated Symbols

Review symbols that are no longer supported, and find replacements.

## Topics

### Methods

[`- (NSData *) dataRepresentationOfType:(NSString *) type;`](/documentation/AppKit/NSDocument/dataRepresentationOfType:)

A primitive method to return a data object that represents the data of the receiver in a given type.

[`- (NSDictionary *) fileAttributesToWriteToFile:(NSString *) fullDocumentPath ofType:(NSString *) documentTypeName saveOperation:(NSSaveOperationType) saveOperationType;`](/documentation/AppKit/NSDocument/fileAttributesToWriteToFile:ofType:saveOperation:)

Returns the file attributes that should be written to the named document file of the specified type.

[`- (NSString *) fileName;`](/documentation/AppKit/NSDocument/fileName)

Returns the fully qualified pathname under which the receiver has been saved.

[`- (NSFileWrapper *) fileWrapperRepresentationOfType:(NSString *) type;`](/documentation/AppKit/NSDocument/fileWrapperRepresentationOfType:)

Returns a file wrapper object that represents the data of the receiver in a given type.

[`- (id) initWithContentsOfFile:(NSString *) absolutePath ofType:(NSString *) typeName;`](/documentation/AppKit/NSDocument/initWithContentsOfFile:ofType:)

Initializes and returns a document object.

[`- (id) initWithContentsOfURL:(NSURL *) url ofType:(NSString *) typeName;`](/documentation/AppKit/NSDocument/initWithContentsOfURL:ofType:)

Initializes and returns a document object of a given type.

[`- (BOOL) loadDataRepresentation:(NSData *) data ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/loadDataRepresentation:ofType:)

Loads the document data.

[`- (BOOL) loadFileWrapperRepresentation:(NSFileWrapper *) wrapper ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/loadFileWrapperRepresentation:ofType:)

Loads document data from a given file wrapper.

[`- (void) printShowingPrintPanel:(BOOL) flag;`](/documentation/AppKit/NSDocument/printShowingPrintPanel:)

Prints the current document’s data.

[`- (BOOL) readFromFile:(NSString *) fileName ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/readFromFile:ofType:)

Reads and loads document data of the given type from the given file.

[`- (BOOL) readFromURL:(NSURL *) url ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/readFromURL:ofType:)

Reads and loads document data.

[`- (BOOL) revertToSavedFromFile:(NSString *) fileName ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/revertToSavedFromFile:ofType:)

Reverts the receiver to the data stored in the file system.

[`- (BOOL) revertToSavedFromURL:(NSURL *) url ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/revertToSavedFromURL:ofType:)

Reverts the receiver.

[`- (NSInteger) runModalPageLayoutWithPrintInfo:(NSPrintInfo *) printInfo;`](/documentation/AppKit/NSDocument/runModalPageLayoutWithPrintInfo:)

Runs the page layout modal panel with the receiver’s printing information object.

[`- (void) saveToFile:(NSString *) fileName saveOperation:(NSSaveOperationType) saveOperation delegate:(id) delegate didSaveSelector:(SEL) didSaveSelector contextInfo:(void *) contextInfo;`](/documentation/AppKit/NSDocument/saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:)

Called after the user has been given the opportunity to select a destination through the modal Save panel.

[`- (BOOL) saveToURL:(NSURL *) url ofType:(NSString *) typeName forSaveOperation:(NSSaveOperationType) saveOperation error:(NSError **) outError;`](/documentation/AppKit/NSDocument/saveToURL:ofType:forSaveOperation:error:)

Saves the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation.

[`- (void) setFileName:(NSString *) fileName;`](/documentation/AppKit/NSDocument/setFileName:)

Sets the file (filename and directory path) under which document data is saved.

[`- (BOOL) writeToFile:(NSString *) fileName ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/writeToFile:ofType:)

Writes document data to a file.

[`- (BOOL) writeToFile:(NSString *) fullDocumentPath ofType:(NSString *) documentTypeName originalFile:(NSString *) fullOriginalDocumentPath saveOperation:(NSSaveOperationType) saveOperationType;`](/documentation/AppKit/NSDocument/writeToFile:ofType:originalFile:saveOperation:)

Writes the receiver document’s contents to a file.

[`- (BOOL) writeToURL:(NSURL *) url ofType:(NSString *) type;`](/documentation/AppKit/NSDocument/writeToURL:ofType:)

Writes document data to a URL.

[`- (BOOL) writeWithBackupToFile:(NSString *) fullDocumentPath ofType:(NSString *) documentTypeName saveOperation:(NSSaveOperationType) saveOperationType;`](/documentation/AppKit/NSDocument/writeWithBackupToFile:ofType:saveOperation:)

This method is called by action methods to save document contents to a file.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)