RKManagedObjectStore Class Reference
Inherits from | NSObject |
Declared in | RKManagedObjectStore.h RKManagedObjectStore.m |
Tasks
Other Methods
-
managedObjectCache
Managed object cache provides support for automatic removal of objects pruned from a server side load. Also used to provide offline object loading
property -
managedObjectContext
propertyOverride managedObjectContext getter to ensure we return a separate context for each NSThread.
-
+ objectStoreWithStoreFilename:
Initialize a new managed object store with a SQLite database with the filename specified
-
+ objectStoreWithStoreFilename:usingSeedDatabaseName:managedObjectModel:
Initialize a new managed object store backed by a SQLite database with the specified filename. If a seed database name is provided and no existing database is found, initialize the store by copying the seed database from the main bundle. If the managed object model provided is nil, all models will be merged from the main bundle for you.
-
+ objectStoreWithStoreFilename:inDirectory:usingSeedDatabaseName:managedObjectModel:
Initialize a new managed object store backed by a SQLite database with the specified filename, in the specified directory. If no directory is specified, will use the app’s Documents directory. If a seed database name is provided and no existing database is found, initialize the store by copying the seed database from the main bundle. If the managed object model provided is nil, all models will be merged from the main bundle for you.
-
– initWithStoreFilename:DEPRECATED_ATTRIBUTE:
Initialize a new managed object store with a SQLite database with the filename specified @deprecated
-
– save
Save the current contents of the managed object store
-
– deletePersistantStoreUsingSeedDatabaseName:
This deletes and recreates the managed object context and persistant store, effectively clearing all data
-
– objectWithID:
Retrieves a model object from the appropriate context using the objectId
-
– objectsWithIDs:
Retrieves a array of model objects from the appropriate context using an array of NSManagedObjectIDs
-
– findOrCreateInstanceOfManagedObject:withPrimaryKeyValue:
Retrieves a model object from the object store given the model object’s class and the primaryKeyValue for the model object. This method leverages techniques specific to Core Data for optimal performance. If an existing object is not found, a new object is created and returned.
-
– objectsForResourcePath:
Returns an array of objects that the ‘live’ at the specified resource path. Usage of this method requires that you have provided an implementation of the managed object cache
Other Methods
-
– applicationDocumentsDirectory
Returns the path to the application’s documents directory.
Properties
Class Methods
objectStoreWithStoreFilename:
Initialize a new managed object store with a SQLite database with the filename specified
+ (RKManagedObjectStore *)objectStoreWithStoreFilename:(NSString *)storeFilename
Declared In
RKManagedObjectStore.h
objectStoreWithStoreFilename:inDirectory:usingSeedDatabaseName:managedObjectModel:
Initialize a new managed object store backed by a SQLite database with the specified filename, in the specified directory. If no directory is specified, will use the app’s Documents directory. If a seed database name is provided and no existing database is found, initialize the store by copying the seed database from the main bundle. If the managed object model provided is nil, all models will be merged from the main bundle for you.
+ (RKManagedObjectStore *)objectStoreWithStoreFilename:(NSString *)storeFilename inDirectory:(NSString *)directory usingSeedDatabaseName:(NSString *)nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:(NSManagedObjectModel *)nilOrManagedObjectModel
Declared In
RKManagedObjectStore.h
objectStoreWithStoreFilename:usingSeedDatabaseName:managedObjectModel:
Initialize a new managed object store backed by a SQLite database with the specified filename. If a seed database name is provided and no existing database is found, initialize the store by copying the seed database from the main bundle. If the managed object model provided is nil, all models will be merged from the main bundle for you.
+ (RKManagedObjectStore *)objectStoreWithStoreFilename:(NSString *)storeFilename usingSeedDatabaseName:(NSString *)nilOrNameOfSeedDatabaseInMainBundle managedObjectModel:(NSManagedObjectModel *)nilOrManagedObjectModel
Declared In
RKManagedObjectStore.h
Instance Methods
applicationDocumentsDirectory
Returns the path to the application’s documents directory.
- (NSString *)applicationDocumentsDirectory
Declared In
RKManagedObjectStore.m
deletePersistantStoreUsingSeedDatabaseName:
This deletes and recreates the managed object context and persistant store, effectively clearing all data
- (void)deletePersistantStoreUsingSeedDatabaseName:(NSString *)seedFile
Declared In
RKManagedObjectStore.h
findOrCreateInstanceOfManagedObject:withPrimaryKeyValue:
Retrieves a model object from the object store given the model object’s class and the primaryKeyValue for the model object. This method leverages techniques specific to Core Data for optimal performance. If an existing object is not found, a new object is created and returned.
- (RKManagedObject *)findOrCreateInstanceOfManagedObject:(Class)class withPrimaryKeyValue:(id)primaryKeyValue
Declared In
RKManagedObjectStore.h
initWithStoreFilename:DEPRECATED_ATTRIBUTE:
Initialize a new managed object store with a SQLite database with the filename specified @deprecated
- (id)initWithStoreFilename:(NSString *)storeFilename DEPRECATED_ATTRIBUTE
Declared In
RKManagedObjectStore.h
objectWithID:
Retrieves a model object from the appropriate context using the objectId
- (NSManagedObject *)objectWithID:(NSManagedObjectID *)objectID
Declared In
RKManagedObjectStore.h
objectsForResourcePath:
Returns an array of objects that the ‘live’ at the specified resource path. Usage of this method requires that you have provided an implementation of the managed object cache
- (NSArray *)objectsForResourcePath:(NSString *)resourcePath
Discussion
See managedObjectCache above
Declared In
RKManagedObjectStore.h