0
我制作了一个Core Data应用程序,并且我想将file.sqlite
保存到默认的不同目录中。我遇到了这个SO thread,然后发布this SO question,该项目似乎是compling,但我的file.sqlite
没有得到保存在我指定的位置。我创建了一个方法,并在AppDelegate.m
文件中添加了一些代码,但storeURL
变量仍然将file.sqlite
保存在默认的“文档目录”中。如何调用我在AppDelegate.m
文件中创建的方法来指定storeURL
的正确位置变量?越狱 - 为Core Data应用程序重新安置“Documents”目录
我应该改变,
NSURL *storeURL = [NSURL fileURLWithPath: [docPath stringByAppendingPathComponent:@"Accounts.sqlite"]];
到
NSURL *storeURL = [NSURL fileURLWithPath: [documentsDirectoryPath stringByAppendingPathComponent:@"Accounts.sqlite"]];
也将这种破解的iOS模拟器支持?
我很抱歉,如果这听起来不礼貌,但我认为一切都在评论你的前一个问题[http://stackoverflow.com/questions有人说/ 11812576/IOS-如何对变化的文件目录。如果您不知道如何调用自己的方法'documentsDirectoryPath',并且如果您不使用调试器来找出您的'storeURL'错误的原因,那么我们无法帮助您。 – 2012-08-07 10:48:37