Getting Started with CoreData

From PeformIQ Upgrade
Jump to navigation Jump to search

Initial Thoughts

Create a new SwiftUI app selecting the uses CodeData option and then define some schema. In this case I plan to derive from the USGS Earthquake monthly summary data



Links

Attribute Types

Looks like NSAttributeType is now deprecated!

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 are:

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