Fetch Limit From An Array
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.