title: ios 5.0 keychain access
body: <p>I want to store user credentials in the keychain.  I found this:
  <a href="http://developer.apple.com/library/ios/#samplecode/GenericKeychain/Listings/Classes_KeychainItemWrapper_m.html#//apple_ref/doc/uid/DTS40007797-Classes_KeychainItemWrapper_m-DontLinkElementID_10" rel="noreferrer">http://developer.apple.com/library/ios/#samplecode/GenericKeychain/Listings/Classes_KeychainItemWrapper_m.html#//apple_ref/doc/uid/DTS40007797-Classes_KeychainItemWrapper_m-DontLinkElementID_10</a></p>
  
  <p>I added the KeychainItemWrapper.h/.m to my project.  Unfortunately it doesn't compile.  I'm targeting iOS 5, guessing that's the problem.</p>
  
  <p>For example, this line:</p>
  
  <pre><code>    [genericPasswordQuery setObject:identifier forKey:(id)kSecAttrGeneric];
  </code></pre>
  
  <p>gives me this error:</p>
  
  <p>cast of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast</p>
  
  <p>I tried the "fix its", but it just introduced different errors. </p>
  
  <p>Suggestions on how to proceed?  I find it odd this wrapper isn't built into the SDK in the first place.
  Is there an new API/example for iOS 5?  I couldn't find one.
  And is iOS 5 really still under NDA?</p>