Data lost when updating iPhone app to new universal version - iphone

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.

Related

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

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.

Does iPhone app updation remove apps Data from iPhone

I wanted to know that if i have installed an application in my iPhone and it has a database attached with that which is saved into the particular app folder in iPhone. Now from my application i am updating the database with adding more records and filling up the database fields.
Now my app has a newer version available. I updated my iphone app. Now does it remove all the database records and create the a new empty database ?? or my all my app personal data will remain there as untouched when app has been updated to newer version.
please guide me friends
Thanks
Well that all depends, all the data in the app bundle will be replaced, If you placed your data in the document directory it will be unaffected.

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.

Testing app upgrade on the iPhone

Say I have app version 1.0 released on the app store. Then I want to release version 1.1.
I will keep existing data that was copied out of the app bundle and into the app's sandbox. These are some XML config files and a sqlite db the user can write data to. These files could need updates that preserve their existing data.
What is the best way to test an upgrade scenario?
Is there any kind of delegate event that is only called on install?
Thanks.
I think testing with AdHoc versions that is dragged dropped in iTunes is a similar upgrade situation.
That's how I tested upgrading our Chess game, so it keeps old and current games on the device.
As for the files/DB I suggest they should contain some version number.
You can use TestFlight for beta testing or preproduction testing.. visit TestFlight.com for more information..