objective-c - 核心数据持久存储中的物理位置(目录)( Objective-C )

标签 objective-c cocoa core-data nsmanagedobject

我正在尝试找出核心数据以托管对象形式保存详细信息的确切物理位置。 我发现 AppDelegate 中实现了以下方法:

- (NSURL *)applicationFilesDirectory
{
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSURL *appSupportURL = [[fileManager URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask] lastObject];
    return [appSupportURL URLByAppendingPathComponent:@"testfile"];
} 

但是我在Application Support目录中找不到任何文件。

最佳答案

只需记录即可。

NSLog(@"%@", applicationFilesDirectory);

然后,您可以从控制台复制 URL 并通过以下方式在 Finder 中打开目录
--G

关于objective-c - 核心数据持久存储中的物理位置(目录)( Objective-C ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30166890/

相关文章:

iphone - 我的 iphone 3gs 应用程序可以在 iphone 4 上正常运行吗?

ios - 两个 Collection View Cell 之间的转换

ios - 使用 Objective-C 下载 AWS S3 文件成功然后不成功

objective-c - 有序集和核心数据 (NSOrderedSet)

ios - swift ,Xcode 6 测试版 4 : How do I retrieve the file path of an image file that is currently being displayed using the Photos framework's assets?

ios - 如何使用自动闪光模式检测闪光灯开/关?

objective-c - 推送 ssl 证书在钥匙串(keychain)中缺少私钥

cocoa - Xcode 应用程序缺少 Cocoa Touch

objective-c - NSApplicationDelegate 应用程序 :openFile. 永远不会到达 openFile: 函数

iphone - 主线程在执行后台线程时正在等待[NSManagedObjectContext(_NSInternalAdditions)lockObjectStore]