Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nav services: how do I get my save location to equal my load location



On 7/24/04 7:49 PM, Bob Sabiston didst favor us with:

> The problem I am having is that my Save Dialog location does not
> equal my Load Dialog location. I think that my CFPreferences are
> working--they're doing *something*. If I load a file, then every
> time I go to Load File after that, even if I'm restarting the app
> in-between, I go to that last load location, like I should.
>
> The same thing for Save. I always go to the last Save location.
> The problem is that I want the Save location and the Load location
> to be the *same*. Now, shouldn't using the same preferencesKey do
> that for me? It's not, and that's the problem. It's acting like I
> have two different preference keys for save and load.

That's the correct behavior for open and save dialogs. If you look at what I
sent you before or if you look in your plist preferences, you'll see that
the preference keys look like this:

AppleNavServices:ChooseFile:1097623923:Path

Note that the key is not just based on your prefs key (that's just the
1097623923 part), but also on the Nav dialog you're using. In this example
it's a open file dialog, so it has ChooseFile as part of the key. Even if I
supply the same "prefs key," a save dialog will end up with a key such as:

AppleNavServices:PutFile:1097623923:Path

Which is a different dictionary key.

The point is that prefs code you supply is only *part* of the key used to
store the preference. The upshot is that the location specified by one kind
of Nav dialog will never be used by any other kind of Nav dialog. If you
want to do that, you'll have to set the current directory manually. The
easiest way to do that is to have both dialogs use a location stored in a
preference. Each time one of them is used, you update the location stored in
the preference. You could even store the preference using CFPreferences. ;-)

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: nav services: how do I get my save location to equal my load location (From: Bob Sabiston <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.