【发布时间】:2011-02-09 12:32:45
【问题描述】:
如何在 XCode 的数据模型编辑器中添加 Fetched Property 以获得一个属性的最小值??
我的模特:
Model http://www.freeimagehosting.net/uploads/b48853070e.png
Item (name, note, storedItem)
StoredItem (price, item)
Item 1 ---> N StoredITem (1->N Relationship)
我希望 Item 有一个名为 minPrice 的提取属性,它的值是在 storedItems 中为 price 设置的最小值。
例子:
Item1 (banana, storedItem1 ... storedItem4, 10)
StoredItem1 (10,item1)
StoredItem2 (15,item1)
StoredItem3 (30,item1)
StoredItem4 (54,item1)
我在 Destination 中放了什么?存储项?
Fetched Property in Data Model Editor http://www.freeimagehosting.net/uploads/2a68de007d.png
我在表达式中放了什么?
Expression in Data Model Editor http://www.freeimagehosting.net/uploads/766ab9af6f.png
【问题讨论】:
标签: cocoa xcode core-data minimum fetched-property