Search code examples
ioskeychainocunit

OCUnit doesn't work with security framework?


When attempting to add secure entries into the keychain using:

SecItemUpdate((CFDictionaryRef)queryKeychain, (CFDictionaryRef)updateAttributes);

I'm getting an errSecNotAvailable error returned but only when running my unit test target. Is the keychain not available during unit testing?


Solution

  • Is the security framework included in the OCUint target?

    I just tested and I have no errors, I can add an item and change an item in the Keychain in an OCUint test.

    I may have my OCUnit setup differently, I am testing against the app, not including the apps files into my unit test.