Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New iPhone app as update to old app, same Bundle identifier, Xcode gives error

Tags:

xcode

iphone

I currently have an app in the App Store and on my device, called, for the sake of this post, MyApp1, with bundle identifier com.myname.myapp.

Over the last couple of weeks I have been rewriting the entire app from scratch, also adding lots of new features, as a new Xcode project alongside the old one. As far as iTunes Connect and iOS are concerned though, it should still be an update do the old (version of the) app.

During testing I had both apps running alongside each other on my device and in the simulator, with the new app using bundle identifier com.myname.myapp2, and everything worked fine.

But now that the app's finished, I want it to overwrite/update the old app on my device and in the simulator, to see if the code importing the data from the old app works as expected. So, I changed the bundle identifier of the new app in its Info.plist to com.myname.myapp, and chose Build and Debug in Xcode. But instead of the new app overwriting the old app while still using the same Documents folder, so it could import the old data, as I expected it to, I got an error.

This is what I'm doing and what happened:

  • Simulator: Reset cache
  • Xcode for MyApp1: Clean All Targets
  • Xcode for MyApp1: Build and Run (using Release configuration)
  • MyApp1: Change some NSUserDefaults data using the app, changes that should later be imported by MyApp2, which uses a different data model
  • Xcode for MyApp1: Stop
  • Xcode for MyApp2: Clean All Targets
  • Xcode for MyApp2: Build and Run (using Release configuration)

What happens is the following error shows up 3 times, each time for a different classs in MyApp2's Console:

Unknown class [class referenced in the MyApp1 MainWindow.xib file] in Interface Builder file.

So it looks like for some reason not all files are overwritten, as the error is caused by the old version's MainWindow.xib being loaded.

(Relatively uninteresting stack frame: http://cl.ly/1F1w1J1u3t1C2U2o2D2C)

Would anyone happen to know how I can make this work, how I can have an essentially new app overwrite the old one on my device and in the simulator, so it will still use the same Documents folder?

Thanks in advance!


Things I already tried, as suggested by others, but didn't help:

  • Restarting Xcode
  • Restarting computer
  • Deleting build folder from Xcode project folder
  • Touching MainWindow.xib
like image 887
Douwe Maan Avatar asked Dec 19 '10 14:12

Douwe Maan


1 Answers

Download the old app's Documents folder to your Mac using the Xcode organizer window. Then remove the old app completely, install the new one. Finally restore the Documents folder backup using the Xcode organizer.

like image 51
Julio Gorgé Avatar answered Nov 06 '22 12:11

Julio Gorgé