Created
May 20, 2016 22:16
-
-
Save inorganik/f9971e65f71e037650b39b5f182e157e to your computer and use it in GitHub Desktop.
iOS Keychain status to string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (NSString *)keychainStatusToString:(OSStatus)status { | |
switch (status) { | |
case 0: | |
return @"Success"; | |
case -4: | |
return @"Function or operation not implemented."; | |
case -50: | |
return @"One or more parameters passed to the function were not valid."; | |
case -108: | |
return @"Failed to allocate memory."; | |
case -2000: | |
return @"Username or servicename nil"; | |
case -25291: | |
return @"No trust results are available."; | |
case -25293: | |
return @"Authorization/Authentication failed."; | |
case -25299: | |
return @"The item already exists."; | |
case -25300: | |
return @"The item cannot be found."; | |
case -25308: | |
return @"Interaction with the Security Server is not allowed."; | |
case -26275: | |
return @"Unable to decode the provided data."; | |
default: | |
return [NSString stringWithFormat:@"Unknown error: %d", (int)status]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment