Created
March 1, 2012 12:49
-
-
Save FlaviuSim/1949656 to your computer and use it in GitHub Desktop.
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
NSString *storePath = [[[selfapplicationDocumentsDirectory] URLByAppendingPathComponent: @"CoreDataStore.sqlite"] path]; | |
// Check if the store exists in. | |
if (![[NSFileManagerdefaultManager] fileExistsAtPath:storePath]) { | |
// copy the payload to the store location. | |
NSString *bundlePath = [[NSBundlemainBundle] bundlePath]; | |
NSString *bundleStore = [bundlePath stringByAppendingPathComponent:@"persistentStore"]; | |
NSError *error = nil; | |
[[NSFileManagerdefaultManager] copyItemAtPath:bundleStore toPath:storePath error:&error]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment