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

Configuration

  •   managedObjectContext

    The managed object context associated with the store.

    property
  •   boundSet

    The NSMutableSet the store is bound to. This property can only be set in the class' initializers.

    property
  •   boundArray

    The NSMutableSet the store is bound to. This property can only be set in the class' initializers.

    property
  •   boundSetOwnsStoreObjects

    When TRUE, objects removed from boundSet will also be removed from the data store.

    property

Properties

boundArray

The NSMutableSet the store is bound to. This property can only be set in the class' initializers.

@property (nonatomic, strong, readonly) NSMutableArray *boundArray

Declared In

SCCoreDataStore.h

boundSet

The NSMutableSet the store is bound to. This property can only be set in the class' initializers.

@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

managedObjectContext

The managed object context associated with the store.

@property (nonatomic, strong) NSManagedObjectContext *managedObjectContext

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.

+ (id)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.

+ (id)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.

- (id)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.

- (id)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