I've provided an update for an application that use keychain in iOS. Please note that the update does not have anything to do in the keychain code.
The problem : when some people install the new application, their previous keychain data are not here anymore, at least from the app. point of view I couldn't acces to these people devices so I can't say if the keychain still have this data.
Me : - How I test : I remove the app. I reinstall the app either from Xcode, form itunes, by drag and drop from Finder. - I've tested it successfully on my targets, described below. - I also tried to simulated as closest as possible with a "ad-hoc" profile
=> Results from all this: I always retrieve my previous data
Nota Bene :
The application was originally developped in iOS 3 and now I use Xcode 4 with iOS 4.3 Thus, from Apple :
The keychain data is also backed up.
__________Targets ____________
People devices with problem: Iphones with iOS 4.3.5 (8L1).
Mine (no problem) : Ipad iOS 4.3.5 (8L1), iPod touch 4.2, simulator
*After many days of rock'n roll with Apple doc,tests, and experimentations I finally understood why there is have different behaviours with keychains.
The main idea is that, as often with Apple : "all is in certificate", not in code, not in project itself.
Important for you to know :
Therefore when you use your ad-hoc profile with the good cert. you will be able to read previous saved data again.
http://useyourloaf.com/blog/2010/4/3/keychain-group-access.html