• 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: Dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dictionary


  • Subject: Re: Dictionary
  • From: "I. Savant" <email@hidden>
  • Date: Fri, 24 Aug 2007 17:47:53 -0400


On Aug 24, 2007, at 5:33 PM, Dallas Brown wrote:

Is it possible, and if so, how, to have a dictionary where one or more values for a key is an array?

Yes, it is. The how is, "exactly how the documentation says". Set the array as the object for some key using -setObject:forKey:


NSArray * myArray = [NSArray arrayWithObjects:[NSNumber numberWithInt: 0], [NSNumber numberWithInt:1], nil];

NSMutableDictionary * myDictionary = [NSMutableDictionary dictionary];
[myDictionary setObject:myArray forKey:@"someKey"];

--
I.S.

_______________________________________________

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


References: 
 >Dictionary (From: Dallas Brown <email@hidden>)

  • Prev by Date: 2 IB Questions
  • Next by Date: Re: 2 IB Questions
  • Previous by thread: Re: Dictionary
  • Next by thread: 2 IB Questions
  • Index(es):
    • Date
    • Thread