Re: EOSortOrdering error
Re: EOSortOrdering error
- Subject: Re: EOSortOrdering error
- From: Randall Perry <email@hidden>
- Date: Wed, 30 Jun 2004 14:03:11 -0400
Never mind, forgot to do this:
NSMutableArray dateOrdering = new NSMutableArray();
dateOrdering.addObject(byDateDesc);
Which changes the sort line to this:
logInfoSorted = EOSortOrdering.sortedArrayUsingKeyOrderArray(logInfo,
dateOrdering);
A bit cumbersome at 1st :-(
> The code below shows my attempt to sort an NSArray of EOs after a fetch. But
> I'm getting the following error:
>
> DirectAction.java:97:
> sortedArrayUsingKeyOrderArray(com.webobjects.foundation.NSArray,com.webobjects
> .foundation.NSArray) in com.webobjects.eocontrol.EOSortOrdering cannot be
> applied to
> (com.webobjects.foundation.NSArray,com.webobjects.eocontrol.EOSortOrdering)
>
> Can anyone see an error in my coding?
>
>
>
> // array to hold fetch
> NSArray logInfo;
>
> // create sort order to sort array in memory
> EOSortOrdering byDateDesc = EOSortOrdering.sortOrderingWithKey("dateTime",
> EOSortOrdering.CompareDescending);
> // create mutable array to hold results of sort
> NSMutableArray logInfoSorted = new NSMutableArray();
>
> // fetch data
> logInfo = ec.objectsWithFetchSpecification(logFetchSpec);
> // if there is data, sort it
> if(logInfo.count() != 0) {
> logInfoSorted = EOSortOrdering.sortedArrayUsingKeyOrderArray(logInfo,
> byDateDesc);
> }
>
>
>
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Design/Development
WebObjects Hosting
Mac Consulting/Sales
http://www.systame.com/
_______________________________________________
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.