iOS - Copy sqlite to bundle for CoreData

孤者浪人 提交于 2019-12-08 03:36:26

I think this happened because when I imported the file from Finder into Xcode, it was named "TestModel" instead of "TestModel.sqlite".

From documentation

bundlePath -- The path of a top-level bundle directory. This must be a valid path. For example, to specify the bundle directory for a Mac app, you might specify the path /Applications/MyApp.app.

*edit: I think I got the wrong method :(, still try this one though!-> Why not use - (NSString *)pathForResource:(NSString *)name ofType:(NSString *)extension? Skip the directory (Since you didn't want one anyway).

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