核心数据是否自动创建SQLite数据库文件? [英] Does core data create a SQLite database file automatically?

查看:127
本文介绍了核心数据是否自动创建SQLite数据库文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

核心数据是否自动创建一个sqlite数据库?

   - (NSPersistentStoreCoordinator *)persistentStoreCoordinator 
{
if(__persistentStoreCoordinator != nil){
return __persistentStoreCoordinator;
}

NSURL * storeURL = [[self applicationDocumentsDirectory] ​​
URLByAppendingPathComponent:@Database.sqlite]


解决方案

是的,该文件在应用程序的documents目录中创建。在模拟器开发过程中,你可以在模拟器文件夹中找到它(现在在Xcode 4.3的Xcode文件夹中移动到DerivedData),如果你想删除它,或者使用你的开发数据库来看你的应用程序一旦安装在设备上。 p>

does core data create a sqlite database automatically? if yes, why it's not visible?

- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
{
if (__persistentStoreCoordinator != nil) {
    return __persistentStoreCoordinator;
}

NSURL *storeURL = [[self applicationDocumentsDirectory]   
URLByAppendingPathComponent:@"Database.sqlite"]

解决方案

Yes it does, the file is created in the app's documents directory. During development with the simulator you can find it in the simulator folder (now moved to DerivedData in your Xcode folder in Xcode 4.3) if you want to delete it or use your development database to see your app once it installed on a device.

这篇关于核心数据是否自动创建SQLite数据库文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆