Re: Directory to save file in NSSavePanel
Re: Directory to save file in NSSavePanel
- Subject: Re: Directory to save file in NSSavePanel
- From: Corbin Dunn <email@hidden>
- Date: Wed, 17 Mar 2010 10:12:40 -0700
On Mar 17, 2010, at 9:39 AM, Matt Neuburg wrote:
> On Wed, 17 Mar 2010 13:40:35 +0530, Nikhil Khandelwal
> <email@hidden> said:
>
>> I am using NSSavePanel in my application. I am using "runModal" on this to
>> show the save panel. The default location it shows to save the file is
>> "Desktop" which I want to change to "Document". I tried "runModalForDirectory"
>> as well however it uses the given file path as save location always. Basically
>> I want NSSavePanel to use "Documents" as default save location and if user
>> change the location while saving the file, next time NSSavePanel should shows
>> the changed location to save the file.
>
> If you're willing to be Snow Leopard only, a combination of directoryURL and
> setDirectoryURL might work. It's a little tricky otherwise because Mac OS X
> does automatically remember the last place the user saved, so the idea is to
> stay out of its way in that case. That info is kept in your user defaults so
> you might be able to examine it. m.
Actually, the behavior Nikhi requested is the default behavior if you pass 'nil' for the directory in the runModalForDirectory methods (or use it for setDirectoryURL:)
If you are using nil, it should default to Documents the first time. If it didn't, then you probably need to wipe some user defaults (possibly in the global domain and for the app).
corbin
_______________________________________________
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