Basic data error about "This NSPersistentStoreCoordinator does not have persistent stores. It cannot perform a save operation."

I got this crash log from many customer reports and I'm pretty sure it isn't caused by the master data migration because I added the following:

NSError *error;

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
                         [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
                         [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
//NSError *error;
persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeUrl options:options error:&error]) {
    ASLog(@"Unresolved error %@, %@", error, [error userInfo]);

return persistentStoreCoordinator;


I got this crash log on the latest version and I found that all these crashes are happening on iOS5.0.1. I assumed it was caused by iCloud backups, that Apple deleted the custom sqlite file since I saved the local data file in the Documents directory, but the user told me that he didn't open iCloud so I can't figure out the root cause. Any suggestions or advice is very, very welcome. Help is greatly appreciated!

And I cannot reproduce this crash problem on my side even in the same environment.


source to share

All Articles