Sqlite文件位置核心数据 [英] Sqlite File Location Core Data
问题描述
通常,核心数据应用的sqlite存储文件位于
Typically, the sqlite store file for core data apps is located in
库>应用程序支持> iPhone模拟器> 7.1(或以较为者为准)您正在使用的版本)>应用程序>(无论哪个文件夹包含您的应用程序)>文档
Library>Application Support>iPhone Simulator>7.1(or whichever version you are using)>Applications>(Whichever folder contains your app)>Documents
文件夹,但我找不到它IOS 8.我认为他们只会在iPhone模拟器文件夹中添加一个8.0文件夹,但它不存在。有没有人能够找到它?
folder, but I can't find it in IOS 8. I would assume they would just add an 8.0 folder inside the iPhone Simulator folder, but it's not there. Has anybody been able to locate it?
推荐答案
我设法找到sqlite文件,现在它在这条路径中:
I managed to locate the sqlite file, and its in this path now:
Library / Developer / CoreSimulator / Devices /(数字和字母)/ data / Containers / Data / Application /(数字和字母)/ Documents /
Library/Developer/CoreSimulator/Devices/(numbers and letters)/data/Containers/Data/Application/(numbers and letters)/Documents/
(数字和字母)代表一个对你的应用程序/计算机来说唯一的文件夹,但是看起来像这样:779AE2245- F8W2-57A9-8C6D-98643B1CF01A
(numbers and letters) stands for a folder that would be unique to your app/computer, but would look like this: 779AE2245-F8W2-57A9-8C6D-98643B1CF01A
我可以通过进入appDelegate.m找到它,向下滚动到
I was able to find it by going into appDelegate.m, scrolling down to the
- (NSURL *)applicationDocumentsDirectory
方法,和NSLogging返回路径,如下所示:
method, and NSLogging the return path, like this:
// Returns the URL to the application's Documents directory.
- (NSURL *)applicationDocumentsDirectory
{
NSLog(@"%@",[[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]);
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
这将为您提供独特的路径,让您更轻松,因为它使用2个未命名的文件夹/字母和数字字符串定位它是棘手的。
This will give you your unique path, making it easier for you, because it is tricky locating it with the 2 unnamed folders/strings of letters and numbers.
这篇关于Sqlite文件位置核心数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!