• 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: EOSortOrdering error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


References: 
 >EOSortOrdering error (From: Randall Perry <email@hidden>)

  • Prev by Date: EOSortOrdering error
  • Next by Date: Deleting shared EOs?
  • Previous by thread: EOSortOrdering error
  • Next by thread: Deleting shared EOs?
  • Index(es):
    • Date
    • Thread