I have an App which uses core data with a persisten database where the user can store data.
The first version of the App was targeted for iOS 4.1
I've done a massive update user-end and developer-end. The App is now targeted for iOS 5.1 because i wanted to take advantadge of Storyboards and ARC. So, instead of going to the old project and begin changing things, I started a new project from scratch. I gave the project the same bundleID and I set the version and build to 2.0 (both of them). The xcode project has a different name, however.
The App works fine in both simulator and device. However in order to check whether the update process will be OK, I installed the old version on both devices (iPhone and iPad) and then, I killed the App from the background and I launched the 2.0 version from xcode.
The App is installed (the icon is updated) but the app won't launch. I tried to tap the App on the home screen again but it just doesn't work. The only way it works is if I delete the App from the device and install the 2.0 version. The problem is that the sqlite database is deleted from the documents and the user will lose his/her data.
On the console the only message is the following:
error: failed to launch '/Users/marcal/Library/Developer/Xcode/DerivedData/pureNMR-ddeelrvexokmoocaqkbwswvyubhi/Build/Products/Debug-iphoneos/pureNMR.app/pureNMR' -- failed to send the qLaunchSuccess packet
I'm sure I'm not the only one who has faced this problem and I'd would really appreciate some help here.
Thanks in advance!
UPDATE:
I've cleaned the Derived Data on Xcode again. Then I checked the App name, which didn't match with the original App (v1.0). When I did that, Xcode changed the bundleID to match the App name, so I had to find out how to change the bundleID again to match the original one. This is important because otherwise it would be considered a new App.
After all that, I installed the v1.0 on the device, quit the app, deleted it from the background and installed the v2.0
Now the console gives me the following error:
error: failed to launch '/Users/marcal/Library/Developer/Xcode/DerivedData/pureNMR-ddeelrvexokmoocaqkbwswvyubhi/Build/Products/Debug-iphoneos/Pure NMR.app/Pure NMR' -- No such file or directory (/Users/marcal/Library/Developer/Xcode/DerivedData/pureNMR-ddeelrvexokmoocaqkbwswvyubhi/Build/Products/Debug-iphoneos/Pure NMR.app/Pure NMR)
The App doesn't launch imediately (this is when it gives me the error). However, the important thing is that when I tap the App on the device it launches perfectly and works just fine. Even better the data stored on the sqlite db on the v1.0 remains there as expected.
I think now the error is because I deleted the derived data, but otherwise is fine.
Further discussion on the problem is welcomed.