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

# setRequiredFileType:

Specifies the file type (as an extension) or a UTI.

```
- (void) setRequiredFileType:(NSString *) type;
```

## Parameters

`type`

String to set as the extension to be appended to any selected files that don’t already have that extension.

## Discussion

If `type` is an extension, it should not include the period that begins the extension. Pass `nil` to indicate any type. File type strings encoding HFS file types are not valid values for this attribute. You need to invoke this method each time the Save panel is used for another file type within the application.

This method is equivalent to using [`allowedFileTypes`](/documentation/AppKit/NSSavePanel/allowedFileTypes) with an array containing only `type` (unless `type` is nil, and then it’s equivalent to setting the property to `nil`).

---

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)