Re: NSDictionary & KVC problem
Re: NSDictionary & KVC problem
- Subject: Re: NSDictionary & KVC problem
- From: Art Isbell <email@hidden>
- Date: Sun, 24 Oct 2004 12:52:20 -1000
On Oct 24, 2004, at 12:42 PM, Nathan Dumar wrote:
public NSDictionary(NSArray objects,
NSArray keys)
Creates an NSDictionary with entries from the contents of the keys
and objects NSArrays. This method steps through objects and keys,
creating entries in the new dictionary as it goes. Each key object
and its corresponding value object is added directly to the
dictionary.
So why did it not do that?
Are you certain that "objects" and "keys" aren't each an array with
one array element?
Here's my code:
prefs = new NSDictionary(thisUser.preferences().valueForKey("value"),
thisUser.preferences().valueForKey("name"));
or equally (I tried both):
NSArray values = new
NSArray(thisUser.family().preferences().valueForKey("value"));
NSArray names = new
NSArray(thisUser.family().preferences().valueForKey("name"));
prefs = new NSDictionary(values, names);
I would check the array returned by
thisUser.preferences().valueForKey("value") to determine whether it's
an array with a single array element. If preference.value() is an
array, then thisUser.preferences().valueForKey("value") will return an
array of arrays. Seems unlikely from the names of your keys, but
something like this must be occurring.
Aloha,
Art
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden