• 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: sorting a pair of arrays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sorting a pair of arrays


  • Subject: Re: sorting a pair of arrays
  • From: Gregory Weston <email@hidden>
  • Date: Tue, 28 Jun 2011 12:40:56 -0400

Mikkel Islay wrote:

> It sounds to me like one way of looking at your data structures is as a NSDictionary with the first array as keys and the second as objects (values).

Which fails the if there's any possibility that the items in the first array aren't unique. Better two have an array of dictionaries where each dictionary holds a respective pair from the current two arrays as their own objects
{
myInt -> 1
myString -> "some string"
}

Then a typical use of either sort descriptors or a comparison proc.
_______________________________________________

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: sorting a pair of arrays
      • From: Mikkel Islay <email@hidden>
  • Prev by Date: Help with relationship objects
  • Next by Date: Re: Reading Adobe Photoshop header, Obj-C
  • Previous by thread: Re: sorting a pair of arrays
  • Next by thread: Re: sorting a pair of arrays
  • Index(es):
    • Date
    • Thread