Re: NSUserDefaults for portable applications
Re: NSUserDefaults for portable applications
- Subject: Re: NSUserDefaults for portable applications
- From: "David V. Kocher" <email@hidden>
- Date: Wed, 22 Feb 2006 22:13:29 +0100
So there is no way to prevent an application from reading/writing
preferences from its default domain? The idea of a portable
application is also that
a) it won't modify any existing preferences on the system even if
from the same application
b) it won't leave any 'traces' on the system but only modify
preferences & application support files on the portable media.
/dk
On 22.02.2006, at 21:59, Conor Dearden wrote:
I have just noticed this will still save the preferences in ~/
Library/
Preferences/<bundleIdentifier>.plist in addition to the custom
location.
There is no reason to remove them from the default location. As you
found
out NSUserDefaults automatically saves them there, but upon load
you are
loading your portable preferences domain above the user defaults, so
anything on your portable location will override the standard
preferences.
By taking a snapshot of the preferences and writing it to the portable
location on application terminate you gain preference portability
as well as
the ability of using bindings and the auto save feature in IB. I
understand
it's redundant but you lose nothing.
Conor
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden