Filtering a single-column NSTableView using NSArrayController

佐手、 提交于 2019-12-04 12:17:45

I have uploaded a project, kindly check.

A rough idea how to do is as: (however understanding is easier by seeing the project)

  1. Create an Array Controller.

  2. Set for Array controller Object

      Mode:Class
    
      Class Name: Your custom Class
    
  3. Received Actions

      add: to the button that will add new objects, typically labelled with +
    
      remove:to the button that will add new objects., typically labelled with -
    
  4. Referencing Bindings(either from table or from here for each column of table).

  5. For search field

     Bindings, Predicate to Array Controller
    
     ControllerKey : filterPredicate
    
     Predicate Format : <class property> contains $value
    
     (if to search in multiple table columns  then <class property 1> contains $value || <class property 2> contains $value etc…. )
    
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!