我潛入iPhone的發展,所以我提前道歉,如果這是一個荒謬的問題,但在使用的核心數據框架的新的iPad應用程序的項目,下面是創建的persistentStoreCoordinator生成的代碼...我在哪裏可以找到我的iPhone應用程序的核心數據持久存儲?
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
if (persistentStoreCoordinator != nil) {
return persistentStoreCoordinator;
}
NSURL *storeUrl = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"ApplicationName.sqlite"]];
NSError *error = nil;
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:nil error:&error]) {
/*
Replace this implementation with code to handle the error appropriately.
abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button.
Typical reasons for an error here include:
* The persistent store is not accessible
* The schema for the persistent store is incompatible with current managed object model
Check the error message to determine what the actual problem was.
*/
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
return persistentStoreCoordinator;
}
我的問題是...
- 我第一次運行該應用程序,如果是不存在的,它會自動創建的ApplicationName.sqllite數據庫?如果不是,它是什麼時候創建的?當數據以編程方式添加到它時?
- 一旦數據庫確實存在,我可以在哪裏找到該文件?我想用另一個程序打開它,以便我可以手動操作數據。
非常感謝您的幫助!我現在要繼續研究這些問題。
謝謝布拉德,你一整天都在幫忙! – BeachRunnerFred 2010-05-10 00:34:54