Reading values from Keychain does not work when in Release mode
moshegutman opened this issue · 2 comments
moshegutman commented
I'm unable to read values from the Keychain when using the Swift compiler Optimization Level [Fastest -O], which is default for Release mode apps.
Seems like these lines are the problem:
var returnedData: Unmanaged<AnyObject>? = nil
let results = Int(SecItemCopyMatching(query, &returnedData))
Possible solution:
http://stackoverflow.com/questions/24145838/querying-ios-keychain-using-swift
var returnedData: AnyObject?
var results = withUnsafeMutablePointer(&returnedData) { SecItemCopyMatching(query, UnsafeMutablePointer($0)) }
vandadnp commented
Hi there, what is the value in the results
variable after you call the SecItemCopyMatching()
function? Thanks.
moshegutman commented
It is an OSStatus
object. Upon success its value will be equal to errSecSuccess