title: Using mergedModelFromBundles: and versioning (CoreData)
body: <p>I'm trying to use the migration feature in CoreData. I've followed the Apple Documentation. I have a problem in the following method:</p>
  
  <pre><code>/**
   Returns the managed object model for the application.
   If the model doesn't already exist, it is created by merging all of the models found in the application bundle.
   */
  - (NSManagedObjectModel *)managedObjectModel {
  
      if (managedObjectModel != nil) {
          return managedObjectModel;
      }
      /* 
       * NSInvalidArgumentException', reason: '*** -[NSCFArray insertObject:atIndex:]: attempt to insert nil'
       * 2010-02-17 16:27:15.338 Patrimoine[3037:207]
       */ 
      managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];    
      return managedObjectModel;
  }
  </code></pre>
  
  <p>It appears that there is the same problem on <a href="http://iphonedevelopment.blogspot.com/2009/09/core-data-migration-problems.html" rel="noreferrer">http://iphonedevelopment.blogspot.com/2009/09/core-data-migration-problems.html</a></p>
  
  <p>Yet I did choose the method Apple suggests, by using the menu option "Add Model Version".</p>
  
  <p>Do you have any idea?</p>