No suitable mapping model found for core data migration

前端 未结 5 1792
走了就别回头了
走了就别回头了 2020-12-29 12:15

I\'m trying to perform an iOS Core Data migration that requires a MappingModel. Core data is not able to use the mapping model for some reason and it falls back to an automa

5条回答
  •  一向
    一向 (楼主)
    2020-12-29 12:26

    The mapping model is probably not sufficient to handle the migration. In this case the mapping model will not be loaded, even if it matches source and destination model.

    Write a test for the migration. Redo the changes to your model step by step and test the migration. That way you will find the change that does prevent the mapping model from loading.

    Lookout for: Renaming attributes or creating attributes without specifying default values. Changing attributes to being non optional.

    In those cases you have to specify the behavior manually within the mapping model.

提交回复
热议问题