#pragma mark 更新钥匙串的数据
- (void)update:(NSString *)service data:(id)data {
OSStatus result;
//查询条件
NSMutableDictionary *keychainQuery = [self getKeychainQuery:service];
//里面只放需要改变的属性,不需要改变都不要放
NSMutableDictionary *tempCheck = [NSMutableDictionary dictionaryWithCapacity:1];
[tempCheck setObject:[NSKeyedArchiver archivedDataWithRootObject:data] forKey:(__bridge_transfer id)kSecValueData];
result = SecItemUpdate((CFDictionaryRef)keychainQuery, (CFDictionaryRef)tempCheck);
NSCAssert( result == noErr, @"Couldn't update the Keychain Item." );
}