I did look into NSPredicate and the Predicate Programming Guide. I
understand the concept of filtering the ArrayController. I just didn't
know how to write en expression asking for all unique values from the
ArrayController for a given key. In the Predicate examples they filter
a single potential result against some criteria. Can I say "only
return unique values from yourself"?


Adam


On Tue, Feb 26, 2008 at 6:03 PM, Philip Bridson
<[EMAIL PROTECTED]> wrote:
>
>
> Yeah there is.
>
> From the documentation:
>
>
>
> You can set a predicate for an array controller to filter the content array.
> You can set the predicate in code (using setFilterPredicate:). You can also
> bind the array controller's filterPredicate binding to a method that returns
> an NSPredicate object. The object that implements the method may be the
> File's Owner or another controller object. If you change the predicate,
> remember that you must do so in a key-value observing compliant way (see
> Key-Value Observing Programming Guide) so that the array controller updates
> itself accordingly.
>
> You can also bind the predicate binding of an NSSearchField object to the
> filterPredicate of an array controller. A search field's predicate binding
> is a multivalue binding, described in Binding Types.
>
> Or simply, create a small method in a object, such as the file owner, that
> returns a NSPredicate. Then bind the controller's filter predicate to the
> file owners predicate method. This will automatically filter your
> controllers values.
>
> Hope this helps.
>
> Phil.
>
> On 26 Feb 2008, at 22:00, Adam Gerson wrote:
>
>
>
> I have a core data object. I would like to populate a TableView with
> only the unique entires for a specific property. Clearly I could
> filter the results in code, I was wondering if there was away for core
> data and bindings to do it.
>
> Adam
> _______________________________________________
>
> 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/philipleebridson%40mac.com
>
> This email sent to [EMAIL PROTECTED]
>
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to