updating ans ios app is causing issues whereas reinstall works fine - iphone

i am experiencing a weird problem. last week i submitted updated app into App store and when it comes live i updated already installed app on my iPhone. i saw lots of issues on my home controller table view. after that i deleted and reinstall the app and it worked fine.
i found same behavior on some other test devices too.
i find it as a big issue because end user will never do reinstallation, he will always update the all and find these issues.
Any help will be highly appreciated.

This problem could be caused by incompatible models between those two versions. For example if you are caching your model objects it would be good practice to clear cache upon upgrade to avoid that problem.

Your application crashed due to update in core data model. Solution for this is you need to learn data migration of coredata. you can learn form here.
Hope you will get what i mean.

Related

Flutter app losing local data when user closes the app

My app uses both shared_preferences and writing to a local json file (getting path using path_provider) for the data that it uses. I recently started testing it (starting 1/1/22) with a larger group and some people are having an issue where the data is lost when they close the app and reopen it. We're testing on both Android and iOS. The first user to have the issue was on iOS and has had it from the beginning. All the other users ran into the problem a couple of days ago (1/12/22) and is a mix of mostly iOS and 1 Android user.
The data persists while the app is running since it's consistent while the user navigates around. I haven't been able to replicate the problem myself and I haven't been able to find out what the issue in my research. Any thoughts of what may be going on?
I found a similar question that mentioned that path_provider provided different paths for storage, but that doesn't seem to be my issue here since the first piece of data that gets called is the shared_preferences data and that is also getting lost.
I did some troubleshooting and we figured out that the devices (mostly iOS) were deleting the data point from shared_preferences. I migrated that point of data to a json file and the issue disappeared. It does say in the documentation not to use shared_preferences for any critical piece of data and now I see why. It worked initially, but had issues later for a lot of people, so I'm probably not going to use it in the future.

putpkt: Error and testing Core-Data Lightweight migration

I have an xcode project that has 4 targets (2 apps, 1 iPhone and 1 iPad version for each). I have recently implemented Core Data Lightweight Migration.
I am currently only testing two of the apps, the iPhone versions, call them App A and App B. I am able to run the current app store version of App A on my iPhone, then install my new version of App A to test the Lightweight Migration. It works fine, no problem.
Then, I try the same thing with App B. I am able to install the current app store version of App B on my iPhone no problem. BUT, when I try in install the new version of app B on my iPhone, I get the following error (or a variant of it) EVERY time: "putpkt: write failed, broken pipe"
I am confused since the two current versions are in the same project and have the exact same settings for every configuration (debug, release, distribution). The is not ad-hoc distribution.
Every post I have read for this error on this forum, and anywhere, suggests things like removing the app, restarting the device, restarting xcode, etc. And sure, I can get it to work that way. BUT I cannot test my migration that way.. If I remove the old version of the app from the device nothing is getting migrated!
I am pulling my hair out over this. The two apps were originally in two different projects, and I added App B to the App A project as a new target - that is the only thing I can think of, as I feel like I have looked at everything. I would really appreciate some help to figure out this problem. I feel sick about sending out a database update that I cannot test - I can't take the chance of corrupting people's data, especially when I have not offered a backup option until this current version. Ugh.
EDIT: when I try to run App B on the device without updating, I often get the following error:
Error Starting Executable... Don't know how to run. Try "help target".
EDIT: I think I am having this trouble because I renamed the product name for app B. I think this changed the bundle and will not allow me to migrate data. I will try to change it back and post an update. It seems like merge bundles IS working well for app A in the meantime.
Making sure the new project and the original project had the same product name and the same data model name fixed this problem for me.

Distinguishing between iPhone app upgrade and app new install?

There is a situation that I am faced with which seems like it has no solution. Here it is:
I have an app on App Store. I didn't write any piece of code for this app keeping the upgrade scenario in mind. For all I could imagine, I never that I would be giving out more versions apart from the one I already have on app store. Now, the situation is that I am required to give an upgrade of my app and with in the new code, I am to identify if it is a new install of the latest version or if it is an upgrade from the older version. I don't know how to approach this as I have not coded my first version appropriately for upgrades? Anybody willing to enlighten me.
See previous thread here iPhone: How do I detect when an app is launched for the first time? I use this in just your scenario and it's fine to introduce it with the update - it copes with the previous version doing none of this.

Core data problems on real device

I had a problem in my simulator - when I want to edit the table in core data or create a new table the program which was using the database fails every time I start it. So I google the problem and I found the solution - every time I want to change something in my tables I have to manually delete my database. So it works fine but nowadays I get the license for testing it on real device, but I do not know how will it works on real device. I work for company and maybe the database will be expanding with some new tables, and I really do not know how to prevent it in real device. I admit it is a strange problem, but can you help me?
If your change your Core Data model during testing, you can easily delete your app from the simulator/device. In this case Xcode will install a new database on your simulator/device when you re-install the app and your app won't crash.
If the app has already been released in iTunes and you want to change the database, you have to implement data migration in your app.
Hope I understood your question right. Please ask if you have any more questions.

ABPersonCopyImageData on iOS4

the ABPersonCopyImageData function in iOS4 SDK 4.0->4.02 seems to return uncropped image
and leads to terrible performance and crashing due to running out of memory. It used
to work fine on OC versions 3.0->3.1.3. I've tried upgrading to 4.02 but still same issues
Is there a workaround for this?
Well now there is ABPersonCopyImageDataWithFormat in the SDK 4.1 which returns either thumbnails or the full image
Thanks for this post. I had a major surprise bug due to this issue in a release and this post helped save the day with rapid bug fix.
Everything had previously worked fine but suddenly went all wrong with users who had contact images of a certain types. Setting the format to kABPersonImageFormatThumbnail completely solved the issue.