Getting Started with CoreData
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
- https://developer.apple.com/documentation/coredata
- https://developer.apple.com/documentation/coredata/setting_up_a_core_data_stack
- https://www.raywenderlich.com/7569-getting-started-with-core-data-tutorial (iOS 12 - So may be dated)
- https://www.oneclickitsolution.com/blog/getting-started-with-core-data-fundamentals/
Attribute Types
Looks like NSAttributeType is now deprecated!
- https://developer.apple.com/documentation/coredata/nsattributedescription#//apple_ref/occ/cl/NSAttributeDescription
- https://developer.apple.com/documentation/coredata/nsattributetype
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