title: iOS: What errors can be caused by NSPersistentStoreCoordinator addPersistentStoreWithType:configuration:URL:options:error:
body: <p>I'm building an iOS app using CoreData. A small number of my users (roughly 1/1000) are reporting that the app crashes shortly after launching. I suspect that the persistent store coordinator is failing to add the database as a persistent store. I've been unable to reproduce any errors in testing and I can't get any debugging info from my users. Does anyone know of any common errors that this method generates?</p>
  
  <pre><code>- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
      if (persistentStoreCoordinator_ != nil) return persistentStoreCoordinator_;
  
      NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"databasefile.sqlite"];
  
      NSError *error = nil;
  
      persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:self.managedObjectModel];
  
      if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&amp;error]) {
          NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
          abort();
      }
  
      return persistentStoreCoordinator_;
  }
  </code></pre>