coreData实体中的私有财产 [英] Private property in coreData entity
本文介绍了coreData实体中的私有财产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有可能在coreData实体中使用私有属性。
Is it possible using private property in coreData entity.
我需要创建一个只带有Get return的变量,该变量返回基于私有NSNumber属性的枚举。
I need to create a var with just Get return that return a enum based in private NSNumber property.
将此属性保留为公开状态,但我想防止外部类更改NSNumber值
Leave this property public works fine, but I want to prevent external classes change NSNumber value
谢谢
推荐答案
可以。现在,CoreData Entity属性存储在扩展中。在主实体类文件中添加和维护自己的自定义逻辑和属性/数据非常容易。
Yes you can. Now that the CoreData Entity properties are stored in an extension. It is very easy to add and maintain your own custom logic and properties/data in the main entity class file.
这篇关于coreData实体中的私有财产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文