Skip to content

Instantly share code, notes, and snippets.

@evadne
Created January 16, 2011 14:59
Show Gist options
  • Save evadne/781857 to your computer and use it in GitHub Desktop.
Save evadne/781857 to your computer and use it in GitHub Desktop.
Inspecting an existing Core Data store with F-Script
basePathString := '/Volumes/Data/Library/Application Support/iPhone Simulator/4.2/Applications/D1AB6AEB-6123-447B-A55F-A14603BA22FF/'
modelName := 'MLTwitterModel.momd'
storeName := 'twitter.evadne.sqlite'
modelURL := (NSURL fileURLWithPath:((basePathString stringByAppendingString:'Milk.app/') stringByAppendingString:modelName))
storeURL := (NSURL fileURLWithPath:((basePathString stringByAppendingString:'Documents/') stringByAppendingString:storeName))
coordinator := NSPersistentStoreCoordinator alloc initWithManagedObjectModel:((NSManagedObjectModel alloc initWithContentsOfURL:modelURL) autorelease)
coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:nil
context := NSManagedObjectContext alloc init
context setPersistentStoreCoordinator:coordinator
context inspectWithSystem:sys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment