Fetched Property in XCode Data Model Editor for minimum value

删除回忆录丶 提交于 2019-12-12 08:23:47

问题


How do I add a Fetched Property in XCode's Data Model Editor for minimum value of one attribute??

My model:

Model http://www.freeimagehosting.net/uploads/b48853070e.png

Item (name, note, storedItem)
StoredItem (price, item)
Item 1 ---> N StoredITem (1->N Relationship)

I want that Item has a fetched property named minPrice and its value is the minimum value setted for price in the storedItems.

Example:

Item1 (banana, storedItem1 ... storedItem4, 10)
StoredItem1 (10,item1)
StoredItem2 (15,item1)
StoredItem3 (30,item1)
StoredItem4 (54,item1)

What do I put in Destination?? StoredItem?

Fetched Property in Data Model Editor http://www.freeimagehosting.net/uploads/2a68de007d.png

And what do I put in Expression??

Expression in Data Model Editor http://www.freeimagehosting.net/uploads/766ab9af6f.png


回答1:


The destination is the type of entity you want back.

It sounds like you want a StoredItem back, since that has a price on it.

What I think you want is a fetched property on Item called minPrice, with this expression:

"@min.storedItems.price"


来源:https://stackoverflow.com/questions/2664776/fetched-property-in-xcode-data-model-editor-for-minimum-value

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!