Core Data never seems to be able to auto-update schema

  • In the past, Core Data was able to deal with a simple addition of a property to an Entity. Now, every time I add a property, I get "Can't find model for source store" errors during auto update.

    I'm using the following options when creating the persistent store coordinator:

    NSDictionary* options = @{ NSMigratePersistentStoresAutomaticallyOption : @true,
        NSInferMappingModelAutomaticallyOption : @true };

    Am I doing something wrong?

    Thanks,

    --
    Rick
  • Forgive the basic question, but do you still have the old version of the model present in your versioned model?

    On 2013-05-28, at 10:18 PM, Rick Mann <rmann...> wrote:

    > In the past, Core Data was able to deal with a simple addition of a property to an Entity. Now, every time I add a property, I get "Can't find model for source store" errors during auto update.
    >
    > I'm using the following options when creating the persistent store coordinator:
    >
    > NSDictionary* options = @{ NSMigratePersistentStoresAutomaticallyOption : @true,
    > NSInferMappingModelAutomaticallyOption : @true };
    >
    > Am I doing something wrong?
    >
    > Thanks,
    >
    > --
    > Rick
  • On May 28, 2013, at 20:50 , Dave Fernandes <dave.fernandes...> wrote:

    > Forgive the basic question, but do you still have the old version of the model present in your versioned model?

    That's an excellent question, and no, I don't. But I still thought I've successfully added properties without actually making different versions. During development, I'm making lots of such changes, and I never make a new file until the previous one has been released in the wild.

    --
    Rick
  • I think I have gotten away with that for development purposes in the past, but that isn't the way it is supposed to work. And things have definitely been tightened up as Core Data has evolved. If you want to open old persistent stores, you will need to have a copy of the model that goes with it.

    On 2013-05-29, at 12:02 AM, Rick Mann <rmann...> wrote:

    >
    > On May 28, 2013, at 20:50 , Dave Fernandes <dave.fernandes...> wrote:
    >
    >> Forgive the basic question, but do you still have the old version of the model present in your versioned model?
    >
    > That's an excellent question, and no, I don't. But I still thought I've successfully added properties without actually making different versions. During development, I'm making lots of such changes, and I never make a new file until the previous one has been released in the wild.
    >
    > --
    > Rick
    >
    >
    >
  • Pity Xcode doesn't automatically make a copy of the model when you make a change (after each build).

    Thanks.

    On May 28, 2013, at 21:14 , Dave Fernandes <dave.fernandes...> wrote:

    > I think I have gotten away with that for development purposes in the past, but that isn't the way it is supposed to work. And things have definitely been tightened up as Core Data has evolved. If you want to open old persistent stores, you will need to have a copy of the model that goes with it.
    >
    > On 2013-05-29, at 12:02 AM, Rick Mann <rmann...> wrote:
    >
    >>
    >> On May 28, 2013, at 20:50 , Dave Fernandes <dave.fernandes...> wrote:
    >>
    >>> Forgive the basic question, but do you still have the old version of the model present in your versioned model?
    >>
    >> That's an excellent question, and no, I don't. But I still thought I've successfully added properties without actually making different versions. During development, I'm making lots of such changes, and I never make a new file until the previous one has been released in the wild.
    >>
    >> --
    >> Rick
    >>
    >>
    >>
    >

    --
    Rick
  • On Tue, 28 May 2013 21:16:05 -0700, Rick Mann said:

    > Pity Xcode doesn't automatically make a copy of the model when you make
    > a change (after each build).

    That would be really annoying during development when your model is changing rapidly.

    Also, IIRC, inferred migration requires that newly added attributes have a default value.

    Cheers,

    --
    ____________________________________________________________
    Sean McBride, B. Eng                <sean...>
    Rogue Research                        www.rogue-research.com
    Mac Software Developer              Montréal, Québec, Canada
previous month may 2013 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    
Go to today