最小值的XCode数据模型编辑器中的获取属性 [英] Fetched Property in XCode Data Model Editor for minimum value

查看:125
本文介绍了最小值的XCode数据模型编辑器中的获取属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在XCode的数据模型编辑器中为一个属性的最小值添加Fetched属性

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

我的模型:

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

我想要该项目有一个获取的属性名为minPrice,它的值是为storedItems中的价格设置的最小值。

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

示例:

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

StoredItem?

What do I put in Destination?? StoredItem?

我在Expression?

And what do I put in Expression??

推荐答案

目标是你想要的实体类型。

The destination is the type of entity you want back.

你想要一个StoredItem回来,因为它有一个价格。

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

我认为你想要的是一个获取的属性项目名为minPrice,用这个表达式:

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

"@min.storedItems.price"

这篇关于最小值的XCode数据模型编辑器中的获取属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆