Closed ChristianKienle closed 7 years ago
@ChristianKienle
[Christain, I am very sorry to hear about your situation. You've done a great job with this app so far]
This feature has gotten a lot harder with XCode 6/ iOS 8. The data directory that persistence files are stored in moves each time the simulator is launched. There is a hidden file that will let you know the UDID and name of simulator. It is located here: ~/Library/Developer/CoreSimulator/Devices/.default_created.plist but I've not been able to figure out how to track the persistence storage points across debugger runs.
To work around this problem in my project I've taken to generating the project file in the iOS code. It is something like this:
#if !(TARGET_OS_EMBEDDED) // This will work for Mac or Simulator but excludes physical iOS devices
- (void) createCoreDataDebugProjectWithType: (NSNumber*) storeFormat storeUrl:(NSString*) storeURL modelFilePath:(NSString*) modelFilePath {
#ifdef DEBUG
NSDictionary* project = @{
@"storeFilePath": storeURL,
@"storeFormat" : storeFormat,
@"modelFilePath": modelFilePath,
@"v" : @(1)
};
NSString* projectFile = [NSString stringWithFormat:@"/tmp/%@.cdp", [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey]];
[project writeToFile:projectFile atomically:YES];
#endif
}
#endif
The nice thing is it works well for Mac and iOS clients.
For reference, a fuller discussion of @yepher's solution can be found on his github site, including a Swift version of the above code.
thanks. I will look into it.
Any update on a fix for this as this App is a great tool when debugging Core Data issues. I liked it so much that I bought it on the App Store in support.
@yepher @steprescott fixed
https://github.com/ChristianKienle/Core-Data-Editor/pull/41
Closing this issue.
Now that Core Data Editor no longer is sandboxed it can locate the default sim/derived data directories and use those to make the initial setup easier/semi-automatic.