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

Re: Sorting Question


  • Subject: Re: Sorting Question
  • From: James Cicenia <email@hidden>
  • Date: Sun, 20 Feb 2005 16:18:07 -0600

No that does has no effect really just duplicates the arrays and still the same problem persists..


On Feb 20, 2005, at 3:18 PM, Ken Anderson wrote:

Try using mutableCopy() on those arrays before mushing them together...

On Feb 20, 2005, at 4:14 PM, James Cicenia wrote:

Hello -

I am trying to sort dates ascending.. but with nulls coming at the bottom.
So this is my code:


EOSortOrdering dateOrdering1 = EOSortOrdering.sortOrderingWithKey("requestedDueDate", EOSortOrdering.CompareAscending);
EOSortOrdering dateOrdering2 = EOSortOrdering.sortOrderingWithKey("submittedDate", EOSortOrdering.CompareAscending);
NSMutableArray myOrdering = new NSMutableArray();
myOrdering.addObject(dateOrdering1);
myOrdering.addObject(dateOrdering2);

EOQualifier myQualifier2;
myQualifier2 = EOQualifier.qualifierWithQualifierFormat("requestedDueDate != null", null);

EOQualifier myQualifier3;
myQualifier3 = EOQualifier.qualifierWithQualifierFormat("requestedDueDate = null", null);

NSMutableArray results1 = (NSMutableArray)EOQualifier.filteredArrayWithQualifier(results, myQualifier2);
NSMutableArray results2 = (NSMutableArray)EOQualifier.filteredArrayWithQualifier(results, myQualifier3);


			EOSortOrdering.sortArrayUsingKeyOrderArray(results1, myOrdering);
			EOSortOrdering.sortArrayUsingKeyOrderArray(results2, myOrdering);
			results1.addObjectsFromArray(results2);

			return results1;


It doesn't work though. Results1 by itself is correct. Results2 by itself is correct.
However when I use the addObjectsFromArray method is seems to be putting
results2 in front of results1?!


However when I reverse it to results2.addObjectsFromArray(results1);
Results2 doesn't show up?!

Any thoughts?

Thanks,
James Cicenia


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


This email sent to email@hidden


_______________________________________________ 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:
    • DUH!!!! Re: Sorting Question
      • From: James Cicenia <email@hidden>
References: 
 >Sorting Question (From: James Cicenia <email@hidden>)
 >Re: Sorting Question (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: Using cell phones with WO...anybody ?
  • Next by Date: Re: Project Wonder on Linux
  • Previous by thread: Re: Sorting Question
  • Next by thread: DUH!!!! Re: Sorting Question
  • Index(es):
    • Date
    • Thread