I have encountered a very strange thing today :
I have an app installed with a dev config (runned from XCode with dev provisionning profile) since iOS 4.3 on my iPhone 4.
Then I have upgraded my iPhone to iOS 5.0. The app was still on the device.
Then I have upgraded my iPhone to iOS 5.0.1. The app was still on the device.
Then I made a restore from my 5.0.1 backup, without doing a new backup when asked : the app has disapeared from the device. Notice that as it was a dev version, the app wasn't into iTunes.
Then I have bought my own app onto the AppStore using a promotional code.
At it s first launch, I've been surprised to notice that all the documents saved by the app in the app's doculent folder were still there.
How can this be possible ? No more app on the device... No app into iTunes... A bought on the AppStore and the documents comes back from nowhere ?
If you didn't delete your development app from the device before doing an iTunes backup, iTunes may have saved/backed-up your app's sandbox Documents directory. iTunes won't restore Developer signed app bundles, but might restore other directories.