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

DistinctRows


  • Subject: DistinctRows
  • From: "Jonathan Fleming" <email@hidden>
  • Date: Mon, 03 Mar 2003 21:43:06 +0000

If I use the code below to create a list of the EOModel attribute named navPageName, how can I then be sure to list only distinct rows? The code is used in a popup list, but instead of:
Home
Home
Home
Reference
Reference
Terms


I want to get:
Home
Reference
Terms

No Fetch spec is used to create the list.

Here's the list code:

/** @TypeInfo TbNavPage */
public NSArray sortedNavPageNames() {
// create new navPage list
EOEditingContext ec = this.session().defaultEditingContext();
NSMutableArray sortedNavPageNameList = new NSMutableArray(EOUtilities.objectsForEntityNamed(ec, "TbNavPage"));


// Sort ordering created here to sort unsorted clients
EOSortOrdering navPageNameSortOrdering =
EOSortOrdering.sortOrderingWithKey("navPageName", EOSortOrdering.CompareAscending);


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

       // Sort away!
       EOSortOrdering.sortArrayUsingKeyOrderArray(sortedNavPageNameList,
                                                  sortOrderings );

       return sortedNavPageNameList;
   }

   Advanced Thanks
   Jonathan

_________________________________________________________________
Overloaded with spam? With MSN 8, you can filter it out http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059
_______________________________________________
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: DistinctRows
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: Help: unreported exception java.io.IOException; must be caught or declared to be thrown
  • Next by Date: Re: 5.2 Not Responding
  • Previous by thread: Re: Help: unreported exception java.io.IOException; must be caught or declared to be thrown
  • Next by thread: Re: DistinctRows
  • Index(es):
    • Date
    • Thread