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

allKeys and allValues


  • Subject: allKeys and allValues
  • From: "gMail.com" <email@hidden>
  • Date: Mon, 04 Oct 2010 23:21:47 +0200
  • Thread-topic: allKeys and allValues

Hi,
On the docs I read that for both the NSDictionary's allKeys and allValues,
the order of the elements in the array is not defined. Ok.
But, are the two arrays aligned each other?

I mean, I have a dictionary containing several entries whose key is, e.g.
@"0", @"3", @"42",...
I show these entries on a tableView picking the dict from the rowIndex.
    aDict = [[dicts allValues] objectAtIndex:row];
It works. But now, If I delete a row, using the rowIndex, I should do

NSString *ID = [[dicts allKeys] objectAtIndex:row];
[dicts removeObjectForKey:ID];

Is that correct?
Is it assured that the n key of the allKeys array always corresponds to the
n value in the allValues array?

--
Leo


_______________________________________________

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

  • Follow-Ups:
    • Re: allKeys and allValues
      • From: Ken Thomases <email@hidden>
    • Re: allKeys and allValues
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: What does core data do during a Save As?
  • Next by Date: Re: allKeys and allValues
  • Previous by thread: NSTextView Line Endings
  • Next by thread: Re: allKeys and allValues
  • Index(es):
    • Date
    • Thread