• 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
Fetch Limit From An Array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fetch Limit From An Array


  • Subject: Fetch Limit From An Array
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Thu, 08 May 2003 15:01:40 +0100

I am using this code below to get a list of EO's in an array, however, I only want the fist two sorted items of the array to show... how do I do this? Or should I be using a fetchSpec instead?

thanks
Jonathan

public NSArray sortedClientDatas()
{
NSMutableArray sortedClientDataList = new NSMutableArray(tbClient().tbClientDatas());


       if (sortByImagePosition != null) {

EOSortOrdering imagePositionSortOrdering =
EOSortOrdering.sortOrderingWithKey("imagePosition", EOSortOrdering.CompareAscending);


           NSArray sortOrderings =
               new NSArray( new Object[]{imagePositionSortOrdering});

           EOSortOrdering.sortArrayUsingKeyOrderArray(sortedClientDataList,
                                                      sortOrderings );
       }

       return sortedClientDataList;
   }

/*------------- Sort Orderings On ClientData List -------------------*/

   public WOComponent orderByImagePosition() {
       setSortByImagePosition("ImagePositionSort");
       return null;
   }

/*------------------- set & get methods for sort iVars ---------------------*/

   // Set & Get sortByImagePosition
   public void setSortByImagePosition(String value) {
       sortByImagePosition = value;
   }

   public String getSortByImagePosition() {
       return sortByImagePosition;
   }
   /*----------------------------------------*/

_________________________________________________________________
Get Hotmail on your mobile phone http://www.msn.co.uk/mobile
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Fetch Limit From An Array
      • From: Art Isbell <email@hidden>
  • Prev by Date: Re: apache2
  • Next by Date: RE: MySQL
  • Previous by thread: Re: MySQL
  • Next by thread: Re: Fetch Limit From An Array
  • Index(es):
    • Date
    • Thread