This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is typically configured as a secondary target on your project | |
// Dump your seed data out of your backend system in JSON format | |
// Add to the project as resources | |
// Run the secondary target in the Simulator | |
- (void)seedTheDatabase { | |
// Setup the object manager | |
RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:@"http://restkit.org"]; | |
objectManager.objectStore = [[RKManagedObjectStore alloc] initWithStoreFilename:@"ContactsSeed.sqlite"]; | |
// Load all the data from the file contacts.json into a seed database |
NewerOlder