3

I'm trying to follow Marcus Zarra in his book 'Core Data'. In the book, he makes a small sample application, but it doesn't give much help when things don't work out...

He starts out by visually designing three entities, and then adding array controllers for each entity to the main nib. Second, he adds a tableview and some other visual components to show data from the array controllers.

So far, I have managed to follow, but now he adds a search field to the gui, and binds it to the same array controller as one of the tableviews. Expected behavior would be for the tableview to get filtered when typing in the search field, but nothing happens.

How do I find out what's wrong?

The relevant parts from the nib is as follow:

NSArrayController Recipes
- Mode = Entity
- Enitity Name = Recipe

TableView w/TableColumn
- Value Bind To Recipes
-- Controller Key = arrangedObjects -- Model Key Path = name

Search Field
- Predicate Bind To Recipes
-- Controller Key = filterPredicate
-- Model Key Path = name
-- Display name = predicate
-- Predicate Format = keyPath contains $value

There are no relevant messages in the console.

regards,
-Vegar

4

1 回答 1

9

书本示例有误,将在下一次印刷中修正。您可以完全删除模型键路径,因为它永远不会被读取并将谓词格式更改为:

name contains[c] $value
于 2010-04-01T22:50:52.833 回答