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:
- Delete the app from my device (tap & hold on the app, then tap the delete button).
- Install the app from TestFlight.
- Run the app. It starts and runs fine - until it makes a Core Data query that causes it to crash. The root cause of the crash is 'keypath bar not found in entity <NSSQLEntity Foo id=3>'
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?