filter Predicate - NSArrayController
filter Predicate - NSArrayController
- Subject: filter Predicate - NSArrayController
- From: Chris Idou <email@hidden>
- Date: Thu, 21 Aug 2008 19:02:21 -0700 (PDT)
I want a search field aka iTunes to filter my NSTableView. I have a list of objects with a "title" field.
The filter predicate of NSArrayController sounds like something that might help. I got as far as writing this predicate:
return [NSComparisonPredicate
predicateWithLeftExpression:[NSExpression expressionForKeyPath:@"title"]
rightExpression:<#(NSExpression *)rhs#>
modifier:NSDirectPredicateModifier
type:NSContainsPredicateOperatorType,
options:NSCaseInsensitivePredicateOption];
To filter on the title, but I'm stumped about what to put as the right side of the predicate. It seems it should somehow refer to the NSSearchField, but I don't know how.
I'm even more stumped about how to use the NSArrayController binding for filter predicate.
Is it just me, or is a lot of this stuff undocumented, or at least very poorly documented, or am I missing something? I'm always quite stumped figuring out how to use a new binding.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden