Did anyone ever managed to get NSSavePanel to accept folders as a valid choice? Googling this question, I can tell it has been asked ad nauseam. However, I didn't find a working solution. It should be possible, since NSOpenPanel is a subclass of NSSavePanel. In my case, both a folder and a filename are valid export destinations.
It's easy to set an empty extension and use the "filename" as a folder to be created, but this doesn't allow the user to pick an existing folder.
Ignoring the filename is also possible, but is not so nice from a GUI perspective.
If you select a folder, but leave the filename empty, the return button is grayed out. How do I gain control over this button?
I tried
but this only gets called when the user hits return.
I tried subclassing, but
is never called.
Any other suggestions?
It's easy to set an empty extension and use the "filename" as a folder to be created, but this doesn't allow the user to pick an existing folder.
Ignoring the filename is also possible, but is not so nice from a GUI perspective.
If you select a folder, but leave the filename empty, the return button is grayed out. How do I gain control over this button?
I tried
Code:
- (BOOL)panel:(id)sender isValidFilename:(NSString *)filename
I tried subclassing, but
Code:
-(BOOL) validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem
Any other suggestions?