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:delegate:
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:delegate:
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
-
– findOrCreateInstanceOfEntity:withPrimaryKeyAttribute:andValue:
Retrieves a model object from the object store given a Core Data entity and the primary key attribute and value for the desired object. Internally, this method constructs a thread-local cache of managed object instances to avoid repeated fetches from the store
-
– 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
-
– applicationDataDirectory
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:delegate:
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 delegate:(id)delegate
Declared In
RKManagedObjectStore.h
objectStoreWithStoreFilename:usingSeedDatabaseName:managedObjectModel:delegate:
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 delegate:(id)delegate
Declared In
RKManagedObjectStore.h
Instance Methods
applicationDataDirectory
Returns the path to the application’s documents directory.
- (NSString *)applicationDataDirectory
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
findOrCreateInstanceOfEntity:withPrimaryKeyAttribute:andValue:
Retrieves a model object from the object store given a Core Data entity and the primary key attribute and value for the desired object. Internally, this method constructs a thread-local cache of managed object instances to avoid repeated fetches from the store
- (NSManagedObject *)findOrCreateInstanceOfEntity:(NSEntityDescription *)entity withPrimaryKeyAttribute:(NSString *)primaryKeyAttribute andValue:(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