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

Re: plist -> popup menu


  • Subject: Re: plist -> popup menu
  • From: Paolo Manna <email@hidden>
  • Date: Sat, 17 May 2003 14:41:44 +0200

The problem is the order of the items in the popup. In the Property List
Editor they are ordered alphabetically, but in the popup they are not.

This because NSDictionary uses a hash mechanism, thus the order the items (or better, the keys) are stored depends on the hash value...

Is there a way I can control the order of the items in the popup?

Instead of an NSArray, use NSMutableArray, and then sort it (either -sortUsingFunction:context: or -sortUsingSelector:): alternatively, you can use the sorting functions of NSArray, but this means creating 2 of them...

Cheers
Paolo
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: plist -> popup menu
  • Next by Date: saveDocument: Troubles.
  • Previous by thread: Re: plist -> popup menu
  • Next by thread: saveDocument: Troubles.
  • Index(es):
    • Date
    • Thread