Re: Binding to NSUserDefaults
Re: Binding to NSUserDefaults
- Subject: Re: Binding to NSUserDefaults
- From: Ken Thomases <email@hidden>
- Date: Sun, 17 Mar 2013 13:31:51 -0500
On Mar 17, 2013, at 1:06 PM, Seth Willits wrote:
> In nibs we bind to NSUserDefaults through NSUserDefaultsController, but is there any point in using NSUserDefaultsController when binding to a default through code? (Or using KVO, also.) It's always seemed to work monitoring NSUserDefaults directly.
Yes, you should bind through NSUserDefaultsController, regardless. Bindings established in IB are not significantly different from bindings established in code.
NSUserDefaults is not KVO-compliant. It may work to fetch the value on a one-time basis (i.e. KVC), but you're not guaranteed to be informed when a default changes.
Regards,
Ken
_______________________________________________
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