Doh! The one permutation I DIDN'T try was: "@distinctUnionOfObjects". I incorrectly reported that I did...
And that, fixed that... Sorry for the noise!!! Peace, Love, and Light, /s/ Jon C. Munson II > -----Original Message----- > From: cocoa-dev-bounces+jmunson=his....@lists.apple.com [mailto:cocoa-dev- > bounces+jmunson=his....@lists.apple.com] On Behalf Of Jon C. Munson II > Sent: Tuesday, February 17, 2009 10:35 AM > To: 'Cocoa-Dev List' > Subject: Attempting to get distinct values from an entity's attribute > > Namaste! > > I'm having trouble with the following code snippet: > > ... > > NSString theKey = @"enti...@distinctunionofobjects."; > theKey = [theKey stringByAppendingString:[aFilterFields > objectAtIndex:[popupFilterOn indexOfSelectedItem]]]; > > // the above two lines produce something like: > // @"enti...@distinctunionofobjects.attributepath" > > aFilterableValues = [resultSet valueForKeyPath:theKey]; > > ... > > I am getting an NSException on the third line (valueForUndefinedKey, > etc.). > "entity" is the name of the entity from which I am attempting to retrieve > distinct values for a certain attribute. aFilterFields is an array that > holds the attribute's true name/key path, and popupFilterOn contains the > human-oriented version of that name (and is linked to the XIB's relevant > popup). resultSet is the array of "entity"s in which I am interested. > > If there are any typos, I re-typed this as my mail client is on a > different > machine - syntactically everything runs fine. > > What I'm trying to do: obtain a list of the distinct values of a given > attribute in an entity. In SQL, this is trivial. > > I. Savant re-pointed me back to "distinctUnionOfObjects" and thus my use > of > it. > > I did try simply (because I could): > > NSString theKey = @" distinctUnionOfObjects."; > > and > NSString theKey = @"@distinctUnionOfObjects."; > > with the same result. > > After re-reading the Apple dox a few times, it occurs to me that this may > be > an inappropriate use of "distinctUnionOfObjects," as it, and its siblings, > in the example snippets Apple provided, was used to return distinct > entities > as opposed to attribute values. 'Course that may be the sample and have > nothing to do with the issue... > > If this isn't the right way to go about this, that's fine - I'd appreciate > a > suggestion for an efficient manner of addressing my issue. > > If anyone wouldn't mind setting me straight on this, I'd appreciate it. > > Many thanks in advance! > > Peace, Love, and Light, > > /s/ Jon C. Munson II > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com > > This email sent to jmun...@his.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com