Save and retrieve value via KeyChain
问题 I'm trying to store an Integer and retrieve it using KeyChain. This is how I save it: func SaveNumberOfImagesTaken() { let key = "IMAGE_TAKEN" var taken = 10 let data = NSKeyedArchiver.archivedDataWithRootObject(taken) let query : [String:AnyObject] = [ kSecClass as String : kSecClassGenericPassword, kSecAttrAccount as String : key, kSecValueData as String : data ] let status : OSStatus = SecItemAdd(query as CFDictionaryRef, nil) } This is how I try to retrieve it: func