I'm seeing an error with Core Data that seems to indicate that the old database is not being deleted when I delete the app from my device. Here are the steps I'm taking to do this:
Now, based on the error stated in step 3, it may seem that 'bar' just doesn't exist on Foo and that my issue is with the Core Data model. However, the same code runs on the Simulator without issue and even runs fine on device when connected through Xcode. (I've verified a number of times that the code I'm using in Xcode to run on the Simulator and device is the same as the code in my TestFlight builds.) The problem only exists when installing via TestFlight, but I see no reason to blame TestFlight for my problems.
The same issue happens for another person on my team following the same steps, so the problem is not specific to my device. The app is not using iCloud, MobileMe, or any other syncing functionality.
Is everything Core Data-related deleted when I delete the app from my device? Does Core Data deletion or initialization behavior change depending on how the app is installed on the device?
So, go ahead and feel free to delete an app's data. But be careful deleting an app's data actually resets that app into a freshly installed app state. And if you delete the Google app's data chances are that you might lose some bookmarks, history or any preferences you have set previously.
Even if a message appears to warn us that deleting the app will also delete the data, this usually only means that the data will be deleted from the device itself; it still exists on the developer's server.
Deleting apps on your smart devices is a great way to clean up your digital space. You can remove apps from Google Chrome by visiting “chrome://apps” in the browser. Offloading is always a better and safer option as it helps you to save storage space.
The persistent store should be located in the AppData > Library > Application Support directory.
Delete Everything (Delete All Objects, Reset Core Data) One approach to delete everything and reset Core Data is to destroy the persistent store. Deleting and re-creating the persistent store will delete all objects in Core Data.
All the files may not be deleted off simulator or in the case of a development build on device. This has something to do with Xcode not wanting to have to reinstall the entire app bundle from scratch every time it builds during development. Instead of trashing everything, it just alters what was changed. This can cause problem e.g. .xcdatamodel files don't seem to be reliably removed from the simulator when the file is removed from the build target.
However, on a release build on device, deleting the app will delete all the files in the apps sandbox i.e. everywhere the app can write.
This will not be the case on a jailbroken device.
After reading the updated parent I would note that this error:
keypath bar not found in entity <NSSQLEntity Foo id=3>
... is generated when you try to access a keypath that the entity doesn't support. This error almost always occurs inside the predicate of a fetch request. A common cause is trying to fetch against a transient attribute. (Fetches run against the store and transient attributes by definition do not exist in the store.)
However, I have seen exactly this sort of error crop up with the development install problems I described above.
Since this is true:
The problem only exists when installing via TestFlight...
... I don't think that:
...but I see no reason to blame TestFlight for my problems
... is really justified. If everything works unless you use TestFlight then it seems reasonable to conclude that TestFlight is triggering the problem.
Deleting an app deletes its sandbox. That includes core data files.
At the risk of offering an obvious suggestion, have you built with the same build configuration? Your build to TestFlight probably uses a Release or AdHoc configuration, your device build probably uses Debug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With