Fixed trying to decode the response object for non-read requests
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||
<false/>
|
||||
<key>IDESourceControlProjectIdentifier</key>
|
||||
<string>6AAF752A-6001-46C3-BB3E-4EA76720DE90</string>
|
||||
<key>IDESourceControlProjectName</key>
|
||||
<string>Locksmith</string>
|
||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||
<dict>
|
||||
<key>9E5DC2F442C5D1D821707804A23B5D894E49AF44</key>
|
||||
<string>https://github.com/matthewpalmer/Locksmith</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectPath</key>
|
||||
<string>Locksmith.xcodeproj</string>
|
||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||
<dict>
|
||||
<key>9E5DC2F442C5D1D821707804A23B5D894E49AF44</key>
|
||||
<string>../..</string>
|
||||
</dict>
|
||||
<key>IDESourceControlProjectURL</key>
|
||||
<string>https://github.com/matthewpalmer/Locksmith</string>
|
||||
<key>IDESourceControlProjectVersion</key>
|
||||
<integer>111</integer>
|
||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||
<string>9E5DC2F442C5D1D821707804A23B5D894E49AF44</string>
|
||||
<key>IDESourceControlProjectWCConfigurations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||
<string>public.vcs.git</string>
|
||||
<key>IDESourceControlWCCIdentifierKey</key>
|
||||
<string>9E5DC2F442C5D1D821707804A23B5D894E49AF44</string>
|
||||
<key>IDESourceControlWCCName</key>
|
||||
<string>Locksmith</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
@@ -23,7 +23,7 @@ class Locksmith: NSObject {
|
||||
|
||||
switch type {
|
||||
case .Create:
|
||||
status = SecItemAdd(requestReference, nil)
|
||||
status = SecItemAdd(requestReference, &result)
|
||||
case .Read:
|
||||
status = SecItemCopyMatching(requestReference, &result)
|
||||
case .Delete:
|
||||
@@ -37,9 +37,13 @@ class Locksmith: NSObject {
|
||||
let error = Locksmith.keychainError(forCode: statusCode)
|
||||
var resultsDictionary: NSDictionary?
|
||||
|
||||
if let data: NSData = result?.takeRetainedValue() as? NSData {
|
||||
// Convert the retrieved data to a dictionary
|
||||
resultsDictionary = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? NSDictionary
|
||||
if let rawValue = result {
|
||||
if type == .Read {
|
||||
if let data = rawValue.takeRetainedValue() as? NSData {
|
||||
// Convert the retrieved data to a dictionary
|
||||
resultsDictionary = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? NSDictionary
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (resultsDictionary, error)
|
||||
|
||||
Reference in New Issue
Block a user