核心数据属性类型列表?
我搜索了Core Data属性类型,但没有成功。核心数据属性类型列表?
当我打开我的实体和属性有以下几种类型:
- 整数
- 双
- 字符串
- 布尔
等
我有兴趣的话,如果有一些Apple页面哪个解释关于哪种使用类型的每个属性。
例如我需要一个属性类型,其中我将保存大约1000个字符的字符串。这种插入类型使用哪种属性类型?
感谢您的帮助
的NSAttributeDescription
class reference常数部分提供:
typedef enum {
NSUndefinedAttributeType = 0,
NSInteger16AttributeType = 100,
NSInteger32AttributeType = 200,
NSInteger64AttributeType = 300,
NSDecimalAttributeType = 400,
NSDoubleAttributeType = 500,
NSFloatAttributeType = 600,
NSStringAttributeType = 700,
NSBooleanAttributeType = 800,
NSDateAttributeType = 900,
NSBinaryDataAttributeType = 1000,
NSTransformableAttributeType = 1800,
NSObjectIDAttributeType = 2000
} NSAttributeType;
你可以找到名单here,在常量节具体描述。
Specifically, typedef enum {
NSUndefinedAttributeType = 0,
NSInteger16AttributeType = 100,
NSInteger32AttributeType = 200,
NSInteger64AttributeType = 300,
NSDecimalAttributeType = 400,
NSDoubleAttributeType = 500,
NSFloatAttributeType = 600,
NSStringAttributeType = 700,
NSBooleanAttributeType = 800,
NSDateAttributeType = 900,
NSBinaryDataAttributeType = 1000,
NSTransformableAttributeType = 1800,
NSObjectIDAttributeType = 2000
} NSAttributeType;
这意味着您可以使用的类型有:
未定义/短暂,短,整型,长,浮动,双,NSDecimalNumber,的NSString,布尔,NSDate的,NSData的,价值变压器,和id
是否有任何链接解释有多少个字符适用于例如属性串? – CroiOS
@CroiOs - 它是无限的 - 请参阅sqlite [文档](http://sqlite.org/faq.html#q9)。 –
你能告诉我有多少字符适合一个位?现在我知道我应该使用属性类型字符串插入1000个字符的字符串。 – CroiOS
@CroiOS使用'NSStringAttributeType'看起来是存储1000个字符的正确选择。任何对每个值大小的限制都可能取决于底层的存储机制。 – *foe
你能告诉我在1位中有多少字符? (1个字符?) – CroiOS