Does a TestFlight upgrade break Core Data schemes in an app? - iphone

I've got an app that I'd like to send to beta testers using TestFlight.
We won't be changing the Core Data model, but I'm curious about two things:
When I send out an updated beta, is there any risk that the Core Data will be corrupted with the update?
When the app goes to the App Store, will our beta testers have to start fresh from the App Store version, or will their Core Data still appear in the App Store version?

The user's data is stored in their own documents directory. If you haven't changed the scheme (or if you have and you have a proper migration set up) then just updating the app will not affect their own data - unless they delete and install the application again.
If you haven't changed the bundle identifier - and they don't delete and re-install their app - the data will still exist in the Document directory.

Related

How to safely upgrade/backup an existing app that uses core data?

I have an app that I've built a few months ago and would like to continue upgrading that app.
Since that time, the app has about 6 months of data, and I would like to backup the state of this app before working on upgrading the app (I'm afraid that I will somehow delete/mess up the core data persistent storage if I install a new version of the app.) I do not remember if I got the app from the iTunes store or xCode installation.
I've backed up my iPhone using iTunes and am currently working with an app which has a different app identifier from the production app:
The live app with data I want to save is called "app"
The work in progress version of the app is called "app_test"
There are two versions of the app on the device.
I would like to see how my changes that I've created for the app_test would look on the live production app with real data.
What steps do I need to take to ensure that I can recover my app's data if something goes wrong?
Is it enough for me to change the xcode's project bundle id from "app_test" to "app" to see changes in production?
Thank you for your input, I really value that data and do not want to lose it!
First important point - do not change your "app_test bundle" identifier to "app" - this will overwrite your live app on the phone, and your data will be gone (well, you'll have to restore from backup at least...)
You should be able to use an OSX program such as 'iPhone Explorer' to browse your connected phone - find your app, and see if you can nab the .sqlite file (maybe in the documents or libray folder of your app) - copy it to your desktop.
Now you've got your live database, you have several choices. You could also nab the app_test database, and merge the contents using your favourite sql tools - or import the live .sqlite file to your app_test xcode project, and tell app_test to use that as the data source.
If you need write access to the database, you'll have to copy the live .sqlite from your app_test bundle to the documents or library folder first.

Data lost when updating iPhone app to new universal version

I had recently created an universal app which was an iphone app only earlier, there were many version updates in that. I launched the universal app with next version that should be. But all the database data is lost when I update the old app to universal app.
Does anyone know how to avoid losing data during the upgrade?
When updating, the data is not erased (kept in the Documents directory), so there are chances that the reason of your data loss is in your code.

Problem in updating app on iPad

I created an app for iOS 3.2 for the first version 1.0.
Recently I created an updated app for iOS 4.2 with print feature etc. for the second version.
My problem is that, the users are not able to update the app from appstore.
They are facing issues like data loss of version 1.0 app, crashing etc.
Can someone explain me what can be the reason for this?
And, how can I test this thing on my device, as I am not having the version 1.0 app from appstore, but the code for both versions.
Delete your new one on your test device and install the old one. Then build and debug the new one line by line. I had lots of trouble my first time through due to confusion over the update/migration process of core data. If you use core data, chances are your existing customers have an out of date store DB that your new code is crashing on. The store doesn't get wiped in an update if it's in your user's document directory... Only the one in the app bundle. You'll need to handle that reset or tell core data to migrate it to the new model. Of course, all this is speculation since you've given almost no details about the problem, frameworks used, log files, etc.
During a normal install process, data should not be overwritten. NSUserDefaults and files should remain during an upgrade, as long as the user doesn't delete the app first. I assume the crashing occurs after the new version is installed?

Core Data - submitting app store updates

Basically when I have an application in XCode and I change the sqlite/coredata database and try to run it on a device that already has the application on it then the app crashes. I have to remove the app and reinstall it.
I have updated the database on an app that has already been submitted to the app store. There has been about 100 downloads, and now I want to submit the update. Will people who have already downloaded it have problems with it? How would I make sure that they don't? There won't be any data in the old database that I will need to be honest, but I'm worried that the app just won't start at all.
Thanks
Tom
From your description I can tell that you've changed the Managed Object Model withtout changing the store version.
Check out this tutorial (may be Mac version, but it should be valid) here.
However, if you with to omit the migration (since you said users won't exactly have any data in the store) you can always change the store path so that it loads another store. However, if you plan any updates and further developement of the app then i strongly recomend to read about core data migration.
Yes the app will probably crash when running with old db.
Apple released an interesting documentation about Core Data versioning and migration called: Core Data Model Versioning and Data Migration Programming Guide
If you read this document, you will learn how to avoid the crashes with updated coredata databases.

The NSPersistentStoreCoordinator 'persist' across app updates?

I know it should persist if my Core Data Model has not changed, but how safe it is ?
I'm an inhouse developer and we have 20 iPods with some information there, entered by our users. Now there's some bug that this info can't be exported, so we have to install a new update and export that information.
We are not going to change the Core Data Model, just some routines for export, so the NSPersistentStoreCoordinator should be the same ...
We are going to pack the app and install the updates from iTunes, this will be ok and the data will be there ?????
thanks,
r.
edit:
so, the iPods were synchronaized with other iTunes, now if I want to update the app that it's there, iTunes says that is going to delete ALL applications and their DATA, and the computer that installed them is not working now ...
so , how I can install a corrected version without losing the data ?????
thanks!
r.
If you have followed practice shown in template generated iPhone apps and copied (or created) your data in the apps Documents folder - then yes, it will still be there when you update from the App Store.