Re: Using NSUserDefaults with NSPreferencePane
Re: Using NSUserDefaults with NSPreferencePane
- Subject: Re: Using NSUserDefaults with NSPreferencePane
- From: "Sherm Pendley" <email@hidden>
- Date: Wed, 23 Jul 2008 14:22:00 -0400
On Wed, Jul 23, 2008 at 10:36 AM, Tim Perrett <email@hidden> wrote:
>
> Im having issues saving my preferences from a preference pane im
> constructing. I have tried using NSUserDefaultsController; to which the
> values appear to be remembered somewhere, but not as a file in any of the
> usual places a plist preference file would be found...
>
> As I need to access these preferences from else where, I need them to be in
> a properly constructed preferences file. I've tried a whole bunch of things
> trying to make this work, but I cant seem to find a way of doing this?
>
> Can anyone point me in the right direction?
You've already *started* in the right direction, you just need to keep
going that way. :-)
NSUserDefaults is the way to go, and USUserDefaultsContoller is the
way to use it with bindings. Later, when you need to access the data
from "elsewhere", you can read it with NSUserDefaults if you're using
Cocoa, CFPreferences* functions from C, or even the
"/usr/bin/defaults" tool if you want to access them from a shell
script.
What you *shouldn't* do is concern yourself with where the preferences
are stored, or in what format. Worrying about those details is Apple's
job. :-)
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
_______________________________________________
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