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 (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