Core Data: Error, “Can't Merge Models With Two Different Entities Named 'foo' ”

前端 未结 9 1051
醉梦人生
醉梦人生 2020-12-05 02:24

I\'m working on an iPhone app that uses Core Data. Most times, I just test in the simulator, but occasionally pump the app down to the iPad to make sure.

I\'ve recen

9条回答
  •  孤街浪徒
    2020-12-05 03:19

    "Can't merge models with two different entities named 'foo'"

    This sounds more like two datamodels beeing merged. Try a clean rebuild of your app. Check if there really is only one datamodel in your project.

    The default core data stack loads all data models in your bundle

    managedObjectModel = [[NSManagedObjectModel mergedModelFromBundles:nil] retain];   
    

    If old models are present all of them are merged.

提交回复
热议问题