Je suis plongée dans le développement iPhone, donc je présente mes excuses à l'avance si c'est une question ridicule, mais dans un nouveau projet d'application iPad en utilisant le framework Core Data, voici le code généré pour la création du persistentStoreCoordinator ...Où puis-je trouver le magasin persistant Core Data de mon application 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;
}
Mes questions sont ...
- la première fois que je lance l'application, est la base de données ApplicationName.sqllite créée automatiquement si elle n'existe pas? Sinon, quand est-il créé? Lorsque les données sont ajoutées par programme?
- Une fois la base de données existante, où puis-je trouver le fichier? Je voudrais l'ouvrir avec un programme différent afin que je puisse manipuler manuellement les données.
Merci beaucoup d'avance pour votre aide! Je vais continuer à faire des recherches sur ces questions maintenant.
Merci, Brad, vous avez été d'une grande aide toute la journée! – BeachRunnerFred