Skip to content

Instantly share code, notes, and snippets.

View blakewatters's full-sized avatar

Blake Watters blakewatters

View GitHub Profile
// This class is a thin model around
@interface RKPath : RKObject {
@private
NSNumber* _label;
NSArray* _route; // An array of hashes
}
@property (nonatomic, retain) NSNumber* label;
@property (nonatomic, retain) NSArray* route;
@end
// 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