List of Core Data attribute types?

I searched for Core Data attribute types, but without success.

When I open my Entity and Attribute, there are several types:

  • Integer
  • Double
  • Line
  • Boolean

and etc.

I am wondering if there is an Apple page that explains each attribute for which the usage type is used.

For example, I need an attribute type in which I will store strings with a length of about 1000 characters. What type of attribute do I use for this type of insertion?

thanks for the help

+6
source share
2 answers

The NSAttributeDescription class reference section gives:

 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; 
+8
source

Here you can find the list specifically described in the constants section.

 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; 

This means that the types available to you are:

Undefined / transient, short, integer, long, float, double, NSDecimalNumber, NSString, Boolean, NSDate, NSData, Value transformers and id

+4
source

Source: https://habr.com/ru/post/915474/


All Articles