[英]If I create a transient property in the model, isn't this managed by core data then?
Just to grok this: If I had a transient property, lets say averagePrice, and I mark that as "transient" in the data modeler: This will not be persistet, and no column will be created in SQLite for that? 只是想一想:如果我有一个transient属性,可以说averagePrice,然后在数据建模器中将其标记为“ transient”:这将不会持久化,并且不会在SQLite中为此创建任何列?
And: If I make my own NSManagedObject subclass with an averagePrice property, does it make any sense to model that property in the xcdatamodel file? 并且:如果我使用averagePrice属性创建自己的NSManagedObject子类,那么在xcdatamodel文件中对该属性进行建模是否有意义? Would it make a difference if I would simply create a property in my subclass and not model that in the entity?
如果仅在子类中创建一个属性而不在实体中对该属性建模,会有所不同吗?
(I think: yes, it doesn't matter at all ... but not sure) (我认为:是的,这并不重要...但不确定)
Transient properties are handled by the undomanager for example. 例如,临时属性由undomanager处理。 In addition changing transient properties makes the document "dirty" if you work in a document based application.
另外,如果您在基于文档的应用程序中工作,则更改瞬态属性会使文档“变脏”。
Creating the property only in your subclass does not affect the whole core data stack at all. 仅在子类中创建属性根本不会影响整个核心数据堆栈。 It depends on your needs which solution to choose
根据您的需求选择哪种解决方案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.