0
votes

I have a project that has a Entity called : Verse. The Verse (entity) has a Attribute called : VerseContent (String). I have it successfully linked to a Table View and I have a Search Bar on the top. The Table View is binded to VersesArrayController (NSArrayController which has it's Managed Object Context binded to my App Delegate's Managed Object Context). I don't really want to write any code and I recall that this is possible through Cocoa Bindings. How should I bind this Search Bar and my NSTableView together?

Thanks~

1

1 Answers

0
votes

Bind the NSSearchField Predicate to VersesArrayController, and leave Model Key Path empty. You'll find Predicate under "Search" in the bindings tab. Then set the Predicate Format to:

verseContent contains $value

Checking Validates Immediately will give you live searching, leaving it unchecked requires you to hit Enter (or some other form of 'Submit').