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.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have a project that you can download and look how it works.
The steps are as :
Drag NSArrayController, set all bindings with this. Create NSSearchField.
In binding inspector, Search “Bind to ArrayController”.
Set Controller Key to “filterPredicate”.
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.