一:使用Core Data 的可用数据类型
NSAttributeTypeDefines the possible types of NSAttributeType properties. These explicitly distinguish between bit sizes to ensure data store independence.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;ConstantsNSUndefinedAttributeTypeSpecifies an undefined attribute type.NSUndefinedAttributeType is valid for transient properties—Core Data will still track the property as an id value and register undo/redo actions, and so on. NSUndefinedAttributeType is illegal for non-transient properties.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSInteger16AttributeTypeSpecifies a 16-bit signed integer attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSInteger32AttributeTypeSpecifies a 32-bit signed integer attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSInteger64AttributeTypeSpecifies a 64-bit signed integer attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSDecimalAttributeTypeSpecifies an NSDecimalNumber attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSDoubleAttributeTypeSpecifies a double attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSFloatAttributeTypeSpecifies a float attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSStringAttributeTypeSpecifies an NSString attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSBooleanAttributeTypeSpecifies a Boolean attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSDateAttributeTypeSpecifies an NSDate attribute.Times are specified in GMT.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSBinaryDataAttributeTypeSpecifies an NSData attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSTransformableAttributeTypeSpecifies an attribute that uses a value transformer.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.NSObjectIDAttributeTypeSpecifies the object ID attribute.Available in iOS 3.0 and later.Declared in NSAttributeDescription.h.AvailabilityAvailable in iOS 3.0 and later.Declared InNSAttributeDescription.h
二:类型
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;
三:
参考: