I am attempting to write a significant upgrade to my application. The upgrade is so significant, I have actually started the code from scratch, there is none of the original code base included in the new version. I have simply copied the *-Info.plist from the old version, and updated the Bundle Version identifier.
I am encountering a problem when I attempt to upgrade from an older (the current App Store) version. When I launch the application on a device via XCode, I am given the message:
Error Starting Executable “Application Name”
Error launching remote program: failed to get the task for process 699.
If I attempt to run the application again after terminating it, I am shown the following in the output window:
2011-10-21 15:40:27.996 Application Name[713:707] Unknown class Application_Name_NewAppDelegate in Interface Builder file.
2011-10-21 15:40:28.013 Application Name[713:707] Unknown class myTabBarController in Interface Builder file.
2011-10-21 15:40:28.019 Application Name[713:707] Unknown class SelectViewController in Interface Builder file.
2011-10-21 15:40:28.037 Application Name[713:707] Unknown class AddDateViewController in Interface Builder file.
2011-10-21 15:40:28.047 Application Name[713:707] Unknown class DisplayViewController in Interface Builder file.
2011-10-21 15:40:28.063 Application Name[713:707] Unknown class AboutViewController in Interface Builder file.
2011-10-21 15:40:28.125 Application Name[713:707] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x16cae0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.'
*** First throw call stack:
(0x3200c8bf 0x31d7c1e5 0x3200c5f5 0x35ba1333 0x35ba0e33 0x35b7af19 0x31f6b803 0x31f6c491 0x32d384bf 0x32d39bb9 0x32c72a45 0x32afc227 0x32af6313 0x32ac4921 0x32ac43bf 0x32ac3d2d 0x3206fe13 0x31fe0553 0x31fe04f5 0x31fdf343 0x31f624dd 0x31f623a5 0x32af5457 0x32af2743 0x21b9 0x2178)
These classes are actually part of the current version, and are not included at all in the new version which I am attempting to upgrade to. So it seems to me like the upgrade is failing for some unknown reason.
Does anyone have any light to shed upon this?
This sounds like a NIB cache issue to me (errors end “…in Interface Builder file”). I’ve seen slightly similar kinds of issues when I have renamed NIBs, not corrected it somewhere in the code, but then been surprised to see that the incorrect name still works due to the NIB cache it would appear. Not a direct parallel but it illustrates the point that there is app data being cached beyond just the current build of the code, and in the case of your error it is referring to interface builder so presumably is the NIB Cache that is of interest.
Normally, doing a “clean build” would fix this issue, but if you’ve completely started from scratch you don’t have any legacy build folder contents, so this would not appear to be the issue. One possibility therefore could be to try clearing the NSCachesDirectory manually yourself and see if this fixes the issue. (Can anyone confirm the NIB Cache is stored in the NSCachesDirectory?)
Secondly, it would appear that the process of building from Xcode may not directly mirror a true AppStore upgrade, as in an actual AppStore upgrade the entire app is deleted excepting the user data directories, so any cached data should be deleted. One answer on this question suggested the interesting idea that building your app and then installing via iTunes might more closely mirror the true upgrade process, and thus tell you whether the problem would exist in a real upgrade rather than building from Xcode. Worth looking into, since all reports are that the NIB Cache is cleared on update.