我对你如何在核心数据中建立关系有疑问。
我将举例说明:
我要说的是,我有3个实体。 • 机动、消耗和警报。
机动车和泵可以发出警告。
警报实体将储存所有来自摩托车和皮乌姆的警告。
因此,问题是...... 是否确实有必要建立如此多的摩托车和皮乌姆预警关系? 当我想增加另一个能够发出警告的实体时,我需要另一种关系。
这难道不是坏的设计吗?
希望我是可以理解的。
感谢。
我对你如何在核心数据中建立关系有疑问。
我将举例说明:
我要说的是,我有3个实体。 • 机动、消耗和警报。
机动车和泵可以发出警告。
警报实体将储存所有来自摩托车和皮乌姆的警告。
因此,问题是...... 是否确实有必要建立如此多的摩托车和皮乌姆预警关系? 当我想增加另一个能够发出警告的实体时,我需要另一种关系。
这难道不是坏的设计吗?
希望我是可以理解的。
感谢。
是的,这是正常的。 一种更好、更有条理的办法是建立一个机动和消耗的基地实体,让它称作构成部分。 该构成部分实体与警报部门有关系,警报实体与构成部分有不正当的关系。
然后,你将你的摩托车和皮泵定为构成部分实体的后代,一切都很好。 构成部分和警告之间的单一关系/反向关系。
This is standard and good practice. Core Data requires inverse relationships for everything to maintain its object graph. (Well, technically you don t have to add them, but you then have to do extra work yourself).
因此,你经常被利用的实体通常会对他们有多种不利关系,这并不令人担心。
Okay, I ll bite. I ve got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, ...
I m using Xcode on OSX to develop command line C applications. I would also like to use Instruments to profile and find memory leaks. However, I couldn t find a way to display the console when ...
Hi I am new to objective c. I am trying to make an app for iphone. I have a button on my view, and the click on which the function playSound is called. This is working properly. It does plays the ...
I have a number of places where I need to re-use some template code. Many classes need these items In a .h could I do something like: #include <xxx.txt> and place all of this code in the ....
This is a follow-up to my previous question . I succeeded in implementing the algorithm for checking umlauted characters. The next problem comes from iterating over all characters in a string. I do ...
我跑了X条码,试图把我的手套放在我的电话上。 I m 获取错误信息:“正在设计的方案没有运行”。
Is it possible to open the same file in two separate windows in Xcode. I can open a file in one window and the same file in the main Xcode editor window, but I wanted two separate fulltime editor ...
In our environment, we share resources across multiple projects and platforms. When building for iPhone, only a subset of those resources are needed. Since that subset is still considerable, we have ...