• 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: Basic Array Access Strategy
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Basic Array Access Strategy


  • Subject: Re: Basic Array Access Strategy
  • From: John Stiles <email@hidden>
  • Date: Thu, 20 Jan 2005 17:19:27 -0800

If you stored them in a structure other than an array, you could query for a certain wavelength without having to sort or walk the array--i.e., a dictionary.
Now if you wanted to find a range--say, all entries between wavelength 440 and 460--then you'd need to get a little bit more clever. If your data was sorted, a binary search would be one way to go.



On Jan 20, 2005, at 5:13 PM, Richard Patterson wrote:

If I have an array of objects where each object has a set of instance variables, how do I ask the array to give me the first object in which one of the instance variables is equal to a certain value without knowing the values for the other variables?

In other words if I have tabular data in which one column is a wavelength and the other columns are red, green and blue sensitivities, is there a way I can find the sensitivities associated with a wavelength of 450 without sorting the array and walking through it on my own? Will I also be told if there is no entry at that wavelength?

Thanks.

Richard Patterson
Illusion Arts
6700 Valjean Avenue
Van Nuys, CA 91406
818 901-1077
FAX: 818 901-1995
email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Basic Array Access Strategy
      • From: Richard Patterson <email@hidden>
References: 
 >Basic Array Access Strategy (From: Richard Patterson <email@hidden>)

  • Prev by Date: Cocoa global hotkey
  • Next by Date: Re: Basic Array Access Strategy
  • Previous by thread: Basic Array Access Strategy
  • Next by thread: Re: Basic Array Access Strategy
  • Index(es):
    • Date
    • Thread