• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSDictionary & KVC problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSDictionary & KVC problem (From: Nathan Dumar <email@hidden>)
 >Re: NSDictionary & KVC problem (From: Ben Ketteridge <email@hidden>)
 >Re: NSDictionary & KVC problem (From: Nathan Dumar <email@hidden>)

  • Prev by Date: Re: NSDictionary & KVC problem
  • Next by Date: Re: Reusable components
  • Previous by thread: Re: NSDictionary & KVC problem
  • Next by thread: RE: NSDictionary & KVC problem
  • Index(es):
    • Date
    • Thread