So basically I’m working on creating a inventory/sales system. I’m using Core Data, and currently the entire inventory section is working great. (Adding new items, removing items, editing, etc.)
I have a entity named “Item” that has many attributes (cost, name, etc.) as well as an attribute “TotalSale”. The TotalSale attribute is meant to represent the quantity of an item on the current invoice. So initially all items are created with TotalSale at value 0. You can edit the value from a table that I already have implemented.
But now I would like to create a new table that ONLY has the items that have a TotalSale value of greater than 0.
So far, I haven’t really touched any coding, most has been done through the interface builder, making connections, etc.
Any help is appreciated!
NSArrayControllers support bindings for filter predicates. It would be relatively trivial to set up a property on your document/window/view controller class that vended such a predicate. Like this:
Then you would bind your second array controller’s Filter Predicate binding to File’s Owner > nonZeroTotalSales.
Pretty easy, really.