Re: NSUserDefaults and binding to an NSDictionary
Re: NSUserDefaults and binding to an NSDictionary
- Subject: Re: NSUserDefaults and binding to an NSDictionary
- From: Matt Neuburg <email@hidden>
- Date: Mon, 16 Oct 2006 12:39:22 -0700
- Thread-topic: NSUserDefaults and binding to an NSDictionary
On or about 10/16/06 12:15 PM, thus spake "Daniel Tapie"
<email@hidden>:
> Hi Matt,
>
> Are you implying I cannot use the Shared Defaults Controller in this
> case?
No. m.
> On 16 oct. 06, at 21:02, Matt Neuburg wrote:
>
>> On Mon, 16 Oct 2006 14:23:24 +0200, Daniel Tapie
>> <email@hidden>
>> said:
>>> Hi there,
>>>
>>> I have a simple question regarding bindings and user defaults and I
>>> could not find an answer in any of the mailing lists (it is probably
>>> very obvious).
>>>
>>> My user defaults contain a few booleans, strings and numbers all of
>>> which work fine when bound to various text fields and checkboxes.
>>>
>>> So, my question is: how do I bind values that are included in an
>>> NSDictionary which itself is one of my user defaults?
>>>
>>> Here is the typical structure of my user defaults:
>>>
>>> --> Key: @"Preference 1", Value (NSString): @"any string"
>>> --> Key: @"Preference 2", Value (NSNumber): 1234
>>> --> Key: @"Sub Preferences", Value (NSDictionary):
>>> --> Key: @"Sub Preference 1", Value (NSString): @"any string"
>>> --> Key: @"Sub Preference 2", Value (NSNumber): 4567
>>>
>>>
>>> So, I tried binding a text field to "Sub Preferences.Sub Preference
>>> 1" but all it does is create a "Sub Preferences.Sub Preference 1"
>>> string and not a dictionary containing the string.
>>
>> Aside from the question of how you are naming your keys, the big
>> trick here
>> is to pass thru a controller where Handles Content as Compound
>> Value is
>> checked. m.
>>
>> --
>> matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
>> A fool + a tool + an autorelease pool = cool!
>> AppleScript: the Definitive Guide - Second Edition!
>> <http://www.amazon.com/gp/product/0596102119>
>>
>>
>>
>>
>
>
>
> Daniel Tapie
>
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
AppleScript: the Definitive Guide - Second Edition!
http://www.amazon.com/gp/product/0596102119
Take Control of Word 2004, Tiger, and more -
http://www.takecontrolbooks.com/tiger-customizing.html
Subscribe to TidBITS! It's free and smart. http://www.tidbits.com/
_______________________________________________
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