Re: DistinctRows
Re: DistinctRows
- Subject: Re: DistinctRows
- From: Art Isbell <email@hidden>
- Date: Mon, 3 Mar 2003 13:43:46 -1000
On Monday, March 3, 2003, at 01:16 PM, Chuck Hill wrote:
There are several ways to accomplish this, including raw SQL and fetch
specs set to fetch distinct rows.
It's not clear to me that the rows fetched aren't already distinct.
No fetch spec is being used to fetch the objects, so unless duplicate
rows are in the DB, only the attribute value being displayed in the
popup button is not distinct.
NSArray pageNameList = EOUtilities.objectsForEntityNamed(ec,
"TbNavPage");
NSSet uniquePageNameList = new NSSet(pageNameList);
NSMutableArray sortedNavPageNameList = new
NSMutableArray(uniquePageNameList.allObjects());
I initially thought about using NSSet, but this won't work unless the
objects in the set are truly duplicates. I suspect only the attribute
bound to the popup button's displayString key is not distinct. But if
that's the case, you wouldn't normally want to eliminate some of the
objects from the popup button list. Something's missing from this
picture. Jonathan?
Art
http://homepage.mac.com/aisbell/
_______________________________________________
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.