iOS Core Data lightweight migration in new version -


i have app multiple updates on appstore already, funny thing happened, thought lightweight migration happens automatically, however, recent discovery need add the

nsdictionary *storeoptions = @{nsmigratepersistentstoresautomaticallyoption:@yes, nsinfermappingmodelautomaticallyoption:@yes}; 

to persistentstorecoordinator shook confidence when realized have 5 core data models.

the question is: when add above line next version of app, going work when update? because right happens when open app .. fancy crash.

thx

it work if automatic lightweight migration possible migration you're trying perform. whether work depends on differences between model used existing data , current version of model. many common changes permit automatic lightweight migration not all. you'll need review docs on kind of migration , decide whether work in case.

if doesn't work, there other ways handle it, example creating mapping file tell core data how make changes can't infer automatically.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -