title: KeychainItemWrapper 'Couldn't add the Keychain Item.'
body: <p>I want to store access token to keychain. But i got the error: <code>Couldn't add the Keychain Item.'</code></p>
  
  <p>I checked some posts on stackoverflow like:
  <a href="https://stackoverflow.com/questions/9886064/storing-email-in-keychain-impossible-keychainitemwrapper">Storing email in keychain impossible (KeychainItemWrapper)</a></p>
  
  <p>MyCode:</p>
  
  <pre><code>let a = NSKeyedArchiver.archivedData(withRootObject: "980a872c17a075367357e25e88c1c0476417092a")
  let keyWrapper = KeychainItemWrapper.init(identifier: "23123123", accessGroup: nil)
  keyWrapper?.setObject(a, forKey: kSecValueData)
  </code></pre>
  
  <ol>
  <li><p>I tried add this</p>
  
  <pre><code>keyWrapper?.setObject(kSecAttrAccessible, forKey: kSecAttrAccessible)
  </code></pre></li>
  <li><p>Change <code>kSecValueData</code> to <code>kSecAttrGeneric</code></p></li>
  </ol>
  
  <p>I am running Xcode 8 with swift 3.0. Any hints thank you!</p>
  
  <p><strong>EDIT</strong>===========================</p>
  
  <p>Viruss mca's answer turn on <strong>Share keychain entitlement</strong> just work once for me : (</p>