• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
filter Predicate - NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Preventing windows from being dragged
  • Next by Date: Re: Preventing windows from being dragged
  • Previous by thread: Re: Newbie question re Xcode on Leopard
  • Next by thread: Re: filter Predicate - NSArrayController
  • Index(es):
    • Date
    • Thread