Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of Core Data attribute types?

I've searched Core Data attribute types but with no success.

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

  1. Integer
  2. Double
  3. String
  4. Boolean

etc.

I'm interested if there is some Apple page which explains about every attribute for which type of usage is.

For example I need an attribute type in which I'll be saving strings of about 1000 characters. Which attribute type do I use for this type of insert?

Thanks for help

like image 1000
iWizard Avatar asked May 11 '12 06:05

iWizard


2 Answers

The NSAttributeDescription class reference constants 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;
like image 139
trojanfoe Avatar answered Oct 21 '22 08:10

trojanfoe


You can find the list here, 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 the types available to you are:

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

like image 4
CrimsonDiego Avatar answered Oct 21 '22 08:10

CrimsonDiego