Re: Preventing NSSavePanel from alerting file overwrite
Re: Preventing NSSavePanel from alerting file overwrite
- Subject: Re: Preventing NSSavePanel from alerting file overwrite
- From: Fritz Anderson <email@hidden>
- Date: Wed, 06 Jun 2012 15:27:04 -0500
On 6 Jun 2012, at 1:03 PM, Lee Ann Rucker wrote:
> Implement "panel:userEnteredFilename:confirmed:". Mine returns "nil" because I put up my own dialog, but that also causes the panel to stay up so the user has to enter something else.
>
> I haven't tried but I'd guess returning a placeholder filename that's known not to exist will also prevent the dialog showing and let the panel close. You can save the incoming filename so you know what the real user choice was, or append a magic extension to mark it as a temporary placeholder for an existing file.
This is a problem for sandboxing:
> Open and Save Dialog Behavior with App Sandbox
>
> Certain NSOpenPanel and NSSavePanel methods behave differently when App Sandbox is enabled for your app:
>
> • You cannot invoke the OK button using the ok: method.
> • You cannot rewrite the user’s selection using the panel:userEnteredFilename:confirmed: method from the NSOpenSavePanelDelegate protocol.
<http://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW8>
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden