• 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
Comparing keys in a dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comparing keys in a dictionary


  • Subject: Comparing keys in a dictionary
  • From: Reuss <email@hidden>
  • Date: Fri, 9 Nov 2001 10:06:59 +0100

Hi everybody,

I stumble over a certainly trivial problem:
I have a dictionary in a file with the following structure:
<dict>
<key>ArrayItem_1</key>
<dict>
<key>Circumference</key>
<string>2</string>
</dict>
<key>ArrayItem_2</key>
<dict>
<key>Circumference</key>
<string>3</string>
</dict>
<key>Class</key>
<string>MyDocument</string>
<key>Version</key>
<string>1</string>
</dict>

When reading this file into memory, I would like to read only the Array_Items into a tableView. So I tried to get the keys and check whether the string "ArrayItem_" is contained. But this doesn't work, at least in the following form:

NSEnumerator *enumerator = [dictionary keyEnumerator];
NSString *key;
while ((key = [enumerator nextObject])) {
if (0 != [key rangeOfString:@"ArrayItem_"]){
[tableViewItemArray addObject:[dictionary objectForKey:key]];
}
}

Could you give me a hint what's wrong or where to read to find more information, please ?

Thank you very much.

Tom

--
_________________________________________________________________
Thomas REUSS
http://reusst.free.fr
_________________________________________________________________


  • Follow-Ups:
    • Re: Comparing keys in a dictionary
      • From: Gideon Tearle <email@hidden>
  • Prev by Date: Where does umask come from?
  • Next by Date: Setting job features when printing without panels
  • Previous by thread: Re: Where does umask come from?
  • Next by thread: Re: Comparing keys in a dictionary
  • Index(es):
    • Date
    • Thread