mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
.RecreateStoreOnModelMismatch does not work #79
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TechMaster on GitHub (Sep 10, 2016).
I found that .RecreateStoreOnModelMismatch does not work. When I configured storage, then added new entity to CoreData model, then I found error.
I also tried with demo source code in github and encounter same problem.
"The model used to open the store is incompatible with the one used to create the store"
@JohnEstropia commented on GitHub (Sep 10, 2016):
Can you reproduce this on iOS 8? I feel this is due to iOS 9's persistent store model caching.
@TechMaster commented on GitHub (Sep 10, 2016):
I am downloading iOS 8 simulator now. But CoreStore crashes in iOS 9 when developer change model : adding new entity, modify new attribute.
Is there any option to turn off iOS 9's persistent store model caching?
@JohnEstropia commented on GitHub (Sep 10, 2016):
Not that I've seen yet. I'll see if there's a way to work around it. Thanks for the report!
@TechMaster commented on GitHub (Sep 10, 2016):
Hi John,
I simulate on iOS 8.4 encounter sample problem. I made a simple project so you can easily reproduce bug at your side in 5'.
Please pull code at https://github.com/TechMaster/SimpleCoreStore
@JohnEstropia commented on GitHub (Sep 10, 2016):
Thank you for your report. I'm afraid I can't reproduce this If I don't have your old xcdatamodeld. You can check that with your app too, if you delete and reinstall your app you won't see this error again (until the next time you change the model). But the cause of this problem is clear so I'll try look for a fix.
@TechMaster commented on GitHub (Sep 10, 2016):
To reproduce error, you just create a new entity in model, you will see error immediately.
For the moment, I work around by deleting the app when model is changed. I think that .RecreateStoreOnModelMismatch does not delete model file.
@JohnEstropia commented on GitHub (Sep 11, 2016):
@TechMaster Please try out the fix I pushed to the
developbranch. If it fixes the problem for you I'll push it to a Cocoapods update@TechMaster commented on GitHub (Sep 11, 2016):
Hi John,
It works perfectly !
I pull your latest source code from develop branch, copy all files, folders in Sources folder then paste to folder Pods\CoreStore\Sources. I compiled and made change to model. The app did not crash any more, it delete old model and copy new compile model.
You can push new code to Cocoapods now. After you push, please let me now, i will test again.
Thanks
@JohnEstropia commented on GitHub (Sep 11, 2016):
Fixed in version 2.0.6. Thanks again!