title: how to delete KeyChainItemData and genericPasswordQuery items from iOS keychain
body: <p>I have been having some troubles with my keychain, I think mainly because I was not aware of how it worked when I first started using it, I tried several variations of adding data and strings passwords etc into my keychain thinking that when I deleted the app from my device it would clear the keychain... I now know this is not how the keychain works so was hoping I could get some help clearing up the junk that is in my keychain now.</p>
  
  <p>The thing is I am now trying to pass some information to my keychain but am receiving the following error</p>
  
  <pre><code>*** Assertion failure in -[KeychainItemWrapper writeToKeychain], /Users/imac/Documents/Iphone applications/Keystone/Keystone/KeychainItemWrapper.m:268
  2013-07-23 11:07:46.086 Keystone[2769:907] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'
  </code></pre>
  
  <p>This error happens when I try to pass some info into the keychainwrapper I have declares as illustrated in the code below.</p>
  
  <pre><code>[keychainItem setObject:@"somestringhere" forKey: (__bridge id)kSecAttrService];
  </code></pre>
  
  <p>I think the code is actually fine, because I think the current junk in my keychain is preventing me from correctly adding to the new items to the keychain. I implement the wrapper like this</p>
  
  <pre><code>KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"gena" accessGroup:@"KeyStone.com.WHATWHAT.GenericKeychainSuite"];
  </code></pre>
  
  <p>I can see this in my debug area.</p>
  
  <p><img src="https://i.stack.imgur.com/r8vE0.png" alt="enter image description here"></p>
  
  <p>As you can see <strong>KeyChainItemData</strong> and <strong>genericPasswordQuery</strong> are already in my keychain with 6 - 5 objects?! weird.
  From that I have tried to clear my keychain using the following code... </p>
  
  <pre><code>[keychainItem resetKeychainItem];
  </code></pre>
  
  <p>The only issue being is that this dose nothing to help me. So I was wondering what I might need to do in order to delete these <strong>KeyChainItemData</strong> and <strong>genericPasswordQuery</strong> entries that seem to be in my keychain preventing me from adding the correct entries.</p>
  
  <p>Any help would be greatly appreciated.</p>
  
  <p>UPDATE:
  So from doing further research when I declare KeychainItemWrapper thats when all of those values are showing themselves in my debugging area, however after trying the same code on a different device that has not had any keychain development done on it it still showed those same values. So I figure its not on the device its got to be something else... hopefully that makes sense.. I will continue trying to find a solution.</p>