Re: NSArrayController, bindings and NSUserDefaults
Re: NSArrayController, bindings and NSUserDefaults
- Subject: Re: NSArrayController, bindings and NSUserDefaults
- From: Steven Riggs <email@hidden>
- Date: Sun, 09 Nov 2008 15:13:30 -0500
Check out a code sample (using no code, just IB)...
http://idisk.mac.com/steven.riggs-Public?view=web
-Steve
On Nov 9, 2008, at 2:41 PM, Andre Masse wrote:
Thanks for your reply Steven,
I've tried that but no luck. I get the following error:
[<NSCFData 0x804a00> valueForUndefinedKey:]: this class is not key
value coding-compliant for the key userName.
In interface builder, you will need an Array controller
done.
Mode: Class Class Name:NSMutableDictionary
done.
Content Array bound to Shared User Defaults Controller -
controller key:values - modal key path:yourDefaultsKey
done.
Make sure handles content as a compound value is checked here.
checked.
I think you need to archive and unarchive when you read and write
each key in your dictionary.
The array controller model key path is an array of objects, so it
don't need any value transformer, right?. Now, somehow somewhere it
will need to unarchive a particular object to get at a member's
value. This is where it bites, how can I set the key path for, let's
say the userName, when this value is encoded somewhere inside the
fully encoded NSData object?
Maybe I got this all wrong and need to use another data structure
for saving in the user defaults database.The "magic" behind the
bindings concept is still pretty confusing to me even after having
read a lot both in books and on the net...
Thanks,
Andre Masse
_______________________________________________
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
_______________________________________________
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