How to Get Path of MOMD File in Core Data

社会主义新天地 提交于 2019-12-04 02:04:11

问题


Ey guys, I have seen this question and have used

self.managedObjectContent= [NSManagedObjectModel mergedModelFromBundles:nil];

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.


回答1:


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.



来源:https://stackoverflow.com/questions/4600312/how-to-get-path-of-momd-file-in-core-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!