IOS 8存储sqlite文件位置核心数据 [英] IOS 8 Store 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文件, p>
I managed to locate the sqlite file, and its in this path now:
库/开发人员/ CoreSimulator /设备/(数字和字母)/数据/容器/数据/应用程序/
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.
这篇关于IOS 8存储sqlite文件位置核心数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!