• 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
NSDictionary allKeys and allValues clarification?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDictionary allKeys and allValues clarification?


  • Subject: NSDictionary allKeys and allValues clarification?
  • From: Matt Gough <email@hidden>
  • Date: Thu, 5 Jan 2006 13:28:13 +0000

OK, so the documentation for allKeys and allValues both state:

'The order of the elements in the array isn’t defined'.

Does that really mean that if i do:

NSArray* keys = [dict allKeys];
NSArray* values = [dict allValues];

that there is no guarantee that the items in the two arrays are in sync with each other.

Should I really be doing:

NSArray* keys = [dict allKeys];

NSArray* values = [dict objectsForKeys:keys notFoundMarker:[NSNull null]];

Thanks

Matt Gough

_______________________________________________
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


  • Follow-Ups:
    • Re: NSDictionary allKeys and allValues clarification?
      • From: j o a r <email@hidden>
    • Re: NSDictionary allKeys and allValues clarification?
      • From: Robert Walker <email@hidden>
  • Prev by Date: Re: TextEdit's sheets curiosity
  • Next by Date: Re: MainMenu
  • Previous by thread: No windowWillClose: on quit?
  • Next by thread: Re: NSDictionary allKeys and allValues clarification?
  • Index(es):
    • Date
    • Thread