core-data error question

Discussion in 'iOS Programming' started by medasmx, Nov 27, 2010.

  1. medasmx macrumors member

    Joined:
    Nov 9, 2008
    #1
    question--What is usually the problem when the below error comes up?

    "The model used to open the store is incompatible with the one used to create the store"

    I am making a core-data windows-based iphone app for an editable table view, sections based on dates. I used code from the "CoreDataBooks" sample code. Any help is appreciated.

    Adam
     
  2. admanimal macrumors 68040

    Joined:
    Apr 22, 2005
    #2
    A store is basically another term for an actual Core Data database. A model is kind of like the format or design of the database, based on the entities and relationships that you define. When the store is initially created, it will be based on whatever model it is meant for. Your app uses the model to figure out how to read a store created with that model. If you change the model and then try to use it to open a store based on an older version of the model (without letting Core Data do any kind of migration), you will get that error.

    You can delete your app from the simulator/device in order for the store to be deleted as well, and then it will be re-created using the newer version of the model the next time you run the app. Of course, you will lose any data that had been in the old store.
     
  3. medasmx thread starter macrumors member

    Joined:
    Nov 9, 2008
    #3
    thanks

    I deleted it off the simulator. It worked. Appreciate the help.

    Adam
     

Share This Page