DistinctRows
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.