mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 12:55:58 +08:00
Fix references in Examples/ to eliminated RKDirectory class
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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];
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user