Created
January 16, 2011 14:59
-
-
Save evadne/781857 to your computer and use it in GitHub Desktop.
Inspecting an existing Core Data store with F-Script
This file contains hidden or 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
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