On May 26, 2005, at 11:21 PM, mmalcolm crawford wrote:
There does not appear to be a means of telling Core Data to deliver
"the first person to have each firstName" out of all the people in
the database. Is there a way to do this within the Core Data
realm itself, or will it require a custom function to scan each
person, and remove the duplicates sharing a given firstName (or
lastName, etc)???
Do you need to do this with a fetch, or is it not "live" based on
what's "in the user interface" already (i.e. you're actually
filtering)? If you're actually filtering, you can probably use
@distinctUnionOfObjects.firstName somewhere along the line...
mmalc
You're right - this is done "live" within the interface. Thanks for the tip about @distinctUnionOfObjects!!!!
I was able to get the concept to work within a ComboBox by setting:
content to email@hiddenName of my NSArrayController (built from the Core Data)
and
contentValues to email@hiddenName of the same array controller
This works perfectly, but I have been unsuccessful in getting the same thing to work within a single column table. I tried using the @distinctUnionOfObjects.firstName bit at various locations within the tableview and the column, as well as by attempting to create a new arraycontroller built using @distinctUnionOfObjects.firstName.
Depending on what I try, I get various errors of the sort:
this class is not key value coding-compliant for the key @distinctUnionOfObjects.
Once I have a ComboBox working, what needs to be done differently for a table?
Fletcher