I can't get the KeychainItemWrapper (Apple example) to work. I've added the KeychainItemWrapper files to my project and when running it on the phone, an exception is thrown by SecItemAdd, saying that one or more parameters were not valid (result code -50). The code triggering the SecItemAdd follows:
KeychainItemWrapper* wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"something" accessGroup:nil];
[wrapper setObject:@"this is my password" forKey:@"password"];
NSLog(@"Password: %@", [wrapper objectForKey:@"password"]);
What is wrong?
The code can be found at http://developer.apple.com/iphone/library/samplecode/GenericKeychain/index.html