|
Hello. I'm working on an app after all Core Data knowledge from Paul's course. After some days of work, two days ago, I had to make little minor changes on my .xcdatamodel. After doing so, the app runs as usual, but no data is persisted. As general swift files for views and so haven't been changed at all, I've double (triple...)-checked files related to Core Data configuracion.
As you can see, everything seems to be ok, but no data persists after app closing. Any idea for further research? Thanks! |
|
You did not mention, I'm guessing you tried this? Did you delete the older application on your test device, and perform a clean build? This may clear old leftovers that may interfere with your updated model. |
|
Thank you very much for your quick response. Yes: I deleted and reinstaled many times the app, both on my iPhone and XCode simulators. Even deleted every simulator and reinstaling them again. EVEN deinstaling XCode, deleting all related files, preferences and so, and reinstalling all again, just in order to be sure that every possible duplicate related to Core Data model or so is deleted. Without sucess. Is there any obscure folder where any old-model could be hidden to run this problem? But in that case, how is it possible that in my iPhone happens the same, even aftet deleting the app? Any further ideas for research? Thank you! |
|
I think we were all hoping that this year's WWDC would have brought us a more Swifty version of CoreData. This was on many folk's wish list. @twoStraws touches upon CoreData, but for advanced answers, most advice is to check out Donny Wal's book. Also Mark Moeykens wrote a Core Data Quick Start which mentions another of his Core Data books Core Data Mastery in SwiftUI. Perhaps you can volunteer to proof read an early version of his new book. See -> Practical Core Data |
|
Ok. Thanks! I'll have a look. The misterious thing is that it has worked ok for weeks until that moment. And that all CD configuration, model, and so, is correct. |
|
Moreover: if I recreate the app from the ground, it doesn't work, also! It seems that it is trying to write and fetch from any obscure data with the same naming ☹ |
|
I had the same issue. If you look through all the console warnings core data generates , you'll see some errors pertaining this. You'll just need to force Xcode to re-generate the data models and not reuse them. What helped me was the following:
hope this helps! EDIT No Cloud, you can skip the first step |
|
|
|
SPONSORED Join a FREE crash course for mid/senior iOS devs who want to achieve an expert level of technical and practical skills – it’s the fast track to being a complete senior developer! Hurry up because it'll be available only until April 28th.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.