I have an iOS application that stores some confidential information in a keychain. When I write values to the keychain, I get error code -34018.
I am currently using the Apple iOS class KeyChainItemWrapper.
Both of the following lines of code get the same error code.
OSStatus res1 = SecItemCopyMatching((__bridge CFDictionaryRef)genericPasswordQuery, (CFTypeRef *)&attributes); OSStatus res = SecItemUpdate((__bridge CFDictionaryRef)updateItem, (__bridge CFDictionaryRef)tempCheck);
This problem does not occur every time, but intermittently. As soon as I get this error, I can no longer write any values to the keychain.
I printed the error description as follows:
NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:res userInfo:nil];
and this is what the error throws:
Error: Error Domain=NSOSStatusErrorDomain Code=-34018 "The operation couldn't be completed. (OSStatus error -34018.)"
ios keychain keychainitemwrapper
Rohit Nisal Jan 03 '15 at 6:42 2015-01-03 06:42
source share