title: how to remove nsdictionary from keychain for replacing
body: <p>I am storing and loading a serialized nsdictionary to the keychain as in this post (<a href="https://stackoverflow.com/questions/9948698/store-nsdictionary-in-keychain">Store NSDictionary in keychain</a>), but I need to be able to update/edit the dictionary contents so I would like to delete it and re add.</p>
  
  <p>I just dont know how to do it. I have the following code taken from the above post:</p>
  
  <pre><code>    KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"arbitraryId" accessGroup:nil]
      NSString *error;
      //The following NSData object may be stored in the Keychain
      NSData *dictionaryRep = [NSPropertyListSerialization dataFromPropertyList:dictionary format:NSPropertyListXMLFormat_v1_0 errorDescription:&amp;error];
      [keychain setObject:dictionaryRep forKey:kSecAttrService];
  
      //When the NSData object object is retrieved from the Keychain, you convert it back to NSDictionary type
      dictionaryRep = [keychain objectForKey:kSecAttrServce];
      NSDictionary *dictionary = [NSPropertyListSerialization propertyListFromData:dictionaryRep mutabilityOption:NSPropertyListImmutable format:nil errorDescription:&amp;error];
  
      SecItemDelete((CFDictionaryRef)dictionaryRep); // doesnt work
  </code></pre>
  
  <p>the values arent deleted from the keychain.</p>
  
  <p>thanks</p>