SCCoreDataStore Class Reference
Inherits from | SCDataStore : NSObject |
Declared in | SCCoreDataStore.h |
Overview
SCCoreDataStore is an SCDataStore subclass that encapsulates Core Data persistent storage, providing means for the SC framework to communicate with this storage to fetch, add, update and remove data objects.
Note: It is very rare when you’ll need to create an SCCoreDataStore instance yourself, as it’s typically automatically created for you when you use the SCEntityDefinition data definition. For example, when you use the SCArrayOfObjectsSection initializer method called [SCArrayOfObjectsSection sectionWithHeaderTitle:entityDefinition:], SCArrayOfObjectsSection automatically sets its dataStore property by calling your entityDefinition’s [SCDataDefinition generateCompatibleDataStore:] method.
Note: For more information on data stores, check out the SCDataStore base class documentation.
Tasks
Creation and Initialization
-
+ storeWithManagedObjectContext:defaultEntityDefinition:
-
+ storeWithManagedObjectContext:boundSet:boundSetEntityDefinition:boundSetOwnsStoreObjects:
-
– initWithManagedObjectContext:defaultEntityDefinition:
-
– initWithManagedObjectContext:boundSet:boundSetEntityDefinition:boundSetOwnsStoreObjects:
Configuration
-
managedObjectContext
property -
boundSet
property -
boundOrderedSet
property -
boundSetOwnsStoreObjects
property
Properties
boundOrderedSet
The NSMutableOrderedSet the store is bound to. This property is automatically set by bindStoreToPropertyName:forObject:withDefinition: method.
@property (nonatomic, strong, readonly) NSMutableOrderedSet *boundOrderedSet
Declared In
SCCoreDataStore.h
boundSet
The NSMutableSet the store is bound to. This property is automatically set by bindStoreToPropertyName:forObject:withDefinition: method.
@property (nonatomic, strong, readonly) NSMutableSet *boundSet
Declared In
SCCoreDataStore.h
boundSetOwnsStoreObjects
When TRUE, objects removed from boundSet will also be removed from the data store.
@property (nonatomic, readonly) BOOL boundSetOwnsStoreObjects
Declared In
SCCoreDataStore.h
Class Methods
storeWithManagedObjectContext:boundSet:boundSetEntityDefinition:boundSetOwnsStoreObjects:
Allocates and returns an initialized SCCoreDataStore given a managed object context and an NSMutableSet to bind the data store to.
+ (instancetype)storeWithManagedObjectContext:(NSManagedObjectContext *)context boundSet:(NSMutableSet *)set boundSetEntityDefinition:(SCEntityDefinition *)definition boundSetOwnsStoreObjects:(BOOL)ownsStoreObjects
Parameters
- context
The Core Data managed object context.
- set
An NSMutableSet that the data store will bind to and fetch all its objects from.
- definition
The entity definition of the entity objects in the bound set.
- ownsStoreObjects
When TRUE, objects removed from the bound set will also be removed from the data store.
Declared In
SCCoreDataStore.h
storeWithManagedObjectContext:defaultEntityDefinition:
Allocates and returns an initialized SCCoreDataStore given a managed object context and an entity definition.
+ (instancetype)storeWithManagedObjectContext:(NSManagedObjectContext *)context defaultEntityDefinition:(SCEntityDefinition *)definition
Parameters
- context
The Core Data managed object context.
- definition
The entity definition of the entity objects in the data store.
Declared In
SCCoreDataStore.h
Instance Methods
initWithManagedObjectContext:boundSet:boundSetEntityDefinition:boundSetOwnsStoreObjects:
Returns an initialized SCCoreDataStore given a managed object context and an NSMutableSet to bind the data store to.
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context boundSet:(NSMutableSet *)set boundSetEntityDefinition:(SCEntityDefinition *)definition boundSetOwnsStoreObjects:(BOOL)ownsStoreObjects
Parameters
- context
The Core Data managed object context.
- set
An NSMutableSet that the data store will bind to and fetch all its objects from.
- definition
The entity definition of the entity objects in the bound set.
- ownsStoreObjects
When TRUE, objects removed from the bound set will also be removed from the data store.
Declared In
SCCoreDataStore.h
initWithManagedObjectContext:defaultEntityDefinition:
Returns an initialized SCCoreDataStore given a managed object context and an entity definition.
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)context defaultEntityDefinition:(SCEntityDefinition *)definition
Parameters
- context
The Core Data managed object context.
- definition
The entity definition of the entity objects in the data store.
Declared In
SCCoreDataStore.h