如何获取MOMD文件在Core Data中的路径 [英] How to Get Path of MOMD File in Core Data
问题描述
我们已经看过这个问题,
self.managedObjectContent= [NSManagedObjectModel mergedModelFromBundles:nil];
但是,我希望能够通过NSLog打印一个文件路径到控制台momd文件的完整路径。问题是我不知道如何使用客观c提取MOMD资源的路径,当我尝试记录 managedObjectContent
到控制台最后打印非常漫长的奥术数据我甚至不关心。那么我该如何获取 momd文件的路径?示例代码!提前感谢。
in my code, however, I would like to be able to print a filepath via NSLog to console with the full path of the momd file. Problem is I don't know how to go about extracting the path to the MOMD resource using objective c, when I try logging managedObjectContent
to console it ends up printing very lengthy arcane data that I don't even care about. So how would I go about getting only the path of the momd file? Sample code please! Thanks in advance.
推荐答案
通过查看资源文件夹中的文件并实现它们,解决了问题.mom文件而不是.momd文件。所以用.mom文件扩展名搜索资源解决了我的问题。
Solved the problem a little while ago by looking at what files were in my resources folder and realizing they are .mom files rather than .momd files. So searching for the resource with the .mom file extension solved my problem.
这篇关于如何获取MOMD文件在Core Data中的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!