Fix references in Examples/ to eliminated RKDirectory class

This commit is contained in:
Blake Watters
2012-08-15 08:03:07 -04:00
parent 461f7a8035
commit 3b686125b8
5 changed files with 7 additions and 7 deletions

View File

@@ -49,7 +49,7 @@
// Create the managed object store and add a SQLite persistent store
NSManagedObjectModel *managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
NSString *storePath = [[RKDirectory applicationDataDirectory] stringByAppendingPathComponent:@"RKCoreDataExample.sqlite"];
NSString *storePath = [RKApplicationDataDirectory() stringByAppendingPathComponent:@"RKCoreDataExample.sqlite"];
NSError *error;
NSPersistentStore *persistentStore = [managedObjectStore addSQLitePersistentStoreAtPath:storePath fromSeedDatabaseAtPath:nil error:&error];
NSAssert(persistentStore, @"Failed to create SQLite store at path %@ due to error: %@", storePath, error);

View File

@@ -51,7 +51,7 @@
// Complete Core Data initialization
NSError *error;
NSString *storePath = [[RKDirectory applicationDataDirectory] stringByAppendingPathComponent:@"RKRelationshipMappingExample.sqlite"];
NSString *storePath = [RKApplicationDataDirectory() stringByAppendingPathComponent:@"RKRelationshipMappingExample.sqlite"];
NSPersistentStore *persistentStore = [managedObjectStore addSQLitePersistentStoreAtPath:storePath fromSeedDatabaseAtPath:nil error:&error];
NSAssert(persistentStore, @"Failed to create persistent store with error: %@", error);
[managedObjectStore createManagedObjectContexts];

View File

@@ -77,7 +77,7 @@
RKLogConfigureByName("RestKit/CoreData", RKLogLevelTrace);
NSError *error;
NSString *seedStorePath = [[RKDirectory applicationDataDirectory] stringByAppendingPathComponent:@"RKSeedDatabase.sqlite"];
NSString *seedStorePath = [RKApplicationDataDirectory() stringByAppendingPathComponent:@"RKSeedDatabase.sqlite"];
RKManagedObjectImporter *importer = [[RKManagedObjectImporter alloc] initWithManagedObjectModel:managedObjectModel storePath:seedStorePath];
[importer importObjectsFromItemAtPath:[[NSBundle mainBundle] pathForResource:@"restkit" ofType:@"json"]
withMapping:statusMapping
@@ -98,7 +98,7 @@
Complete Core Data stack initialization
*/
[managedObjectStore createPersistentStoreCoordinator];
NSString *storePath = [[RKDirectory applicationDataDirectory] stringByAppendingPathComponent:@"RKTwitter.sqlite"];
NSString *storePath = [RKApplicationDataDirectory() stringByAppendingPathComponent:@"RKTwitter.sqlite"];
NSString *seedPath = [[NSBundle mainBundle] pathForResource:@"RKSeedDatabase" ofType:@"sqlite"];
NSError *error;
NSPersistentStore *persistentStore = [managedObjectStore addSQLitePersistentStoreAtPath:storePath fromSeedDatabaseAtPath:seedPath error:&error];