• 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
indexing non-sorted arrays in EOs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

indexing non-sorted arrays in EOs


  • Subject: indexing non-sorted arrays in EOs
  • From: Jeff Schmitz <email@hidden>
  • Date: Wed, 23 Apr 2008 22:02:24 -0500

As I get into full swing of using EO's, I'm seeing one place that I know is going to bite me, and that is indexing into the array returned by the parameterless function that returns "many" relationships and assuming a certain order.  I'd almost rather not even have that function, at least by default, so that it would force me to always either qualify or sort the  results.  e.g.

Doing this (assuming the array is sorted appropriately for winIndex:
    WinAnalysis currWA = currGame.winAnalyses().objectAtIndex(winIndex);

Instead of this:
   EOQualifier winQual = WinAnalysis.PLACE.eq(winIndex + 1);
    WinAnalysis currWA = currGame.winAnalyses(winQual).lastObject();

Or am I missing something?  I'm just really scared this is going to bite me, and cost me LOTS of debugging time.  

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

This email sent to email@hidden

  • Follow-Ups:
    • Re: indexing non-sorted arrays in EOs
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Unable to decrement snapshot count ....count is already 0 or does not exist
  • Next by Date: Getting all Session Objects From Application
  • Previous by thread: Re: Unable to decrement snapshot count ....count is already 0 or does not exist
  • Next by thread: Re: indexing non-sorted arrays in EOs
  • Index(es):
    • Date
    • Thread