Core Data - submitting app store updates - iphone

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.

Related

Adding new entities into Core Data without deleting previous version to avoid app crash

Hi I am iOS beginner and having CoreData implemented in my app.
Everytime I added new entities in my coredata, I need to re-create the NSManagedObject subclass, clean project, delete the existing app with previous core data and rebuild the app.
I'm thinking that what if my app is v1.0 and available in AppStore, user download and use the app. After few months I added new entities in Core Data (app v2.0), and user need to update their app. Are they needed to delete and re-download the new version to avoid app crash?
I found out someone mentioned that "You can configure core data to look for, and accept extensions of your data model" but I don't know what it means.
Here is the question.
Any suggestion?
Here is the programming guide Core Data Model Versioning and Data Migration

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?

iPhone app's Core Data, after upgrade to App Store?

I managed to finish upload my first iPhone app to Apple's App Store couple of days ago. My app is based on Core Data so it contains users' data to their devices.
What I want to know is that what happens when I upgrade the app with or without altering Core Data? (altering means add new entity or property, etc)
From my experience, I downloaded my own app from Apple's App Store and saved some data and then I install the same app from my computer using XCode with slight change to interface that has nothing to do with Core Data. When I turned on the app, the data is all there.
Is it safe to upload an upgraded version of iPhone's app to Apple's App Store assuming that as long as we don't touch Core Data, user's data would not be influenced?
If you change Core Data model, it may need to migrate/update its scheme. Apple has the appropriate documentation. The work necessary to perform a migration depends on what you change.

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.