6

I have a nstableview. I would like to filter the results based on the characters entered in a search bar in OSX. So how do i bind the table view and the search field in OSX not in IOS? :) Thanks.

user1999892
  • 135
  • 1
  • 8

1 Answers1

6

I have a project that you can download and look how it works.

The steps are as :

  1. Drag NSArrayController, set all bindings with this. Create NSSearchField.

  2. In binding inspector, Search "Bind to ArrayController".

  3. Set Controller Key to "filterPredicate".

  4. Set Predicate Format to "property1 contains $value" If you want a single search field to search on multiple values(say 3) use || as : "property1 contains $value || property2 contains $value || property3 contains $value"

Also, this StackOverFlow Question.

Community
  • 1
  • 1
Anoop Vaidya
  • 46,283
  • 15
  • 111
  • 140