Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS App Version Upgrade - Does Bundle content get deleted?

Looking for some concrete detail on how version to version upgrade works in iOS, specifically what happens to bundle content that has been removed in the new version? For example, if version 1.0 has a file called "foo.png" in the bundle, but version 2.0 does not, does iOS remove the existing foo.png during upgrade? Or does it leave it there? Thanks, alex

like image 782
Alex Avatar asked Dec 27 '22 13:12

Alex


2 Answers

The way to think about it is this:

  1. The old bundle (executable, resources, etc) is completely removed.
  2. The new bundle is plunked down in its place.
  3. The app's file system outside the bundle is left untouched.

All your app-stored data, documents, and user defaults stay exactly where the are. The new version of your app will wake up to find all that state still there and need to handle it correctly. But none of the old app bundle's resources are there, though-- you don't need to worry about seeing upgrades and versioning of those things.

like image 52
Ben Zotto Avatar answered Feb 13 '23 00:02

Ben Zotto


Upgrading removes all old files. You will only have the files that belongs to your target in the bundle after updating.

This is actually crucial. Say you delete a nib. If it isn't actually deleted, it will still be initialized from simply being in the file system of the bundle. And you will probably not have IBOutlets etc in your view controller for connections in the xib you deleted. This will cause the application to crash when initializing the nib.

like image 25
August Lilleaas Avatar answered Feb 12 '23 23:02

August Lilleaas