---
title: "panel:isValidFilename:"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/panel:isvalidfilename:"
---

# panel:isValidFilename:

Gives the delegate the opportunity to validate selected items.

## Declaration

```occ
- (BOOL) panel:(id) sender isValidFilename:(NSString *) filename;
```

## Parameters

- `sender`: Panel requesting filename validation.
- `filename`: String representing the filename to validate.

## Return Value

Return Value YES if the filename is valid, or NO if the save panel should stay in its modal loop and wait for the user to type in or select a different filename or names.

## Discussion

Discussion The NSSavePanel object sender sends this message just before the end of a modal session for each filename displayed or selected (including filenames in multiple selections). If the delegate refuses a filename in a multiple selection, none of the filenames in the selection is accepted.

## See Also

### Related Documentation

- [panel(_:validate:)](appkit/nsopensavepaneldelegate/panel(_:validate:).md)
