<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.0.0 - 10.4.0"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSDocument/loadFileWrapperRepresentation:ofType:",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDocument(im)loadFileWrapperRepresentation:ofType:"
  },
  "title" : "loadFileWrapperRepresentation:ofType:"
}
-->

# loadFileWrapperRepresentation:ofType:

Loads document data from a given file wrapper.

```
- (BOOL) loadFileWrapperRepresentation:(NSFileWrapper *) wrapper ofType:(NSString *) type;
```

## Discussion

Loads document data in file wrapper `wrapper` of type `docType` into the receiver, displays it in windows, and returns whether the operation was successful. If `wrapper` is a simple file, it invokes [`loadDataRepresentation:ofType:`](/documentation/AppKit/NSDocument/loadDataRepresentation:ofType:) to load the data. If `wrapper` is a directory, it returns <doc://com.apple.documentation/documentation/Swift/false> by default; subclasses can override to handle file wrappers that are directories. This method is typically invoked by [`readFromFile:ofType:`](/documentation/AppKit/NSDocument/readFromFile:ofType:) after it creates an NSData object from the contents of the 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)