• 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
How to control the order of enumerating on a NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to control the order of enumerating on a NSDictionary


  • Subject: How to control the order of enumerating on a NSDictionary
  • From: JArod Wen <email@hidden>
  • Date: Sun, 24 Aug 2008 19:36:33 -0400

Hi Jedis,

I wrote codes to add column information into a NSDictionary and then added each of them into a NSTableView as column. I got the key-value pairs in NSDictionary as following:

        "ang (A)" = 2;
        "dis (D)" = 1;
        "pos (P)" = 0;
        "shp (S)" = 3;

Then I used an enumerator on the keys(strings like "ang (A)") of this dictionary and added each of them into NSTableView. However, the final order of the column is:

2008-08-24 19:16:55.679 Roboplasm[1031:10b] Column added titled pos (P)
2008-08-24 19:16:55.687 Roboplasm[1031:10b] Column added titled shp (S)
2008-08-24 19:16:55.725 Roboplasm[1031:10b] Column added titled dis (D)
2008-08-24 19:16:55.734 Roboplasm[1031:10b] Column added titled ang (A)

I want to set the order of the columns as the value of the object in dictionary, so it should be: pos, dis, ang, shp.

It should be the problem when enumerating the dictionary, right? How can I control the order of enumerating?

Thanks in advance!

---------------
JArod Wen




_______________________________________________

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: How to control the order of enumerating on a NSDictionary
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: Core Data Question 1
  • Next by Date: Re: How to control the order of enumerating on a NSDictionary
  • Previous by thread: Re: *** -[NSSavePanel _blocksActionWhenModal:]: message sent to deallocated instance 0x15a05e50
  • Next by thread: Re: How to control the order of enumerating on a NSDictionary
  • Index(es):
    • Date
    • Thread