title: mapping model is NULL - core data migration
body: <p>I follow this nice tutorial  <a href="http://mipostel.com/index.php/home/70-core-data-migration-standard-migration-part-2" rel="nofollow">http://mipostel.com/index.php/home/70-core-data-migration-standard-migration-part-2</a> to do my core data migration. </p>
  
  <p>For some strange reason i always get NULL in the mappingModel in these lines:</p>
  
  <pre><code> NSMappingModel *mappingModel = [NSMappingModel mappingModelFromBundles:nil
                                                                  forSourceModel:sourceModel
                                                                destinationModel:destinationModel];
  </code></pre>
  
  <p>(line 191 in the linked code)</p>
  
  <p>I tried to create a very simple derived version of the model, I recreated a mappingModel a 1000 times, made sure that the mapping model file is in the project directory - but this call always returns NULL.</p>
  
  <p>Anybody has an idea what is wrong here?</p>
  
  <p>ps I was just wondering that setting the migration options is called AFTER the mapping Model is used.</p>
  
  <pre><code>   NSURL *storeUrl = [NSURL fileURLWithPath:storePath];   
      NSError *error;   
      NSDictionary *pscOptions = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
                                  [NSNumber numberWithBool:NO], NSInferMappingModelAutomaticallyOption,
                                  nil];
  
      if (![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType
                                                    configuration:nil
                                                              URL:storeUrl
                                                          options:pscOptions
                                                            error:&amp;error]) {
          NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
          abort();
      }   
  </code></pre>
  
  <p>(lines 123...)</p>
  
  <p><strong>Anyway</strong></p>
  
  <p><strong>Why can't the mapping model be found ?</strong></p>
  
  <p>pss couldn't help holding back :-) this core data migration stuff is much too complicated and difficult compared to doing simple SQL DB migration - wasting soooo much time.</p>
  
  <p>So a BIG THANKS in advance!</p>