vaultExists2

Tests whether the specified vault exists, returns true if the vault exists; otherwise returns false. If an error occurs while reading the keychain, throws an kDataVaultExceptionReasonIORead exception.

Syntax

+ (BOOL)vaultExists2:(NSString*)dataVaultID;

Parameters

  • dataVaultID – the vault name.

Returns

Returns true if the vault exists; otherwise returns false. If an error occurs while reading the keychain, throws an kDataVaultExceptionReasonIORead exception.

Examples

  • Check if a data vault exists – checks if a data vault called myVault exists, and if so, deletes it.
    @try {
       if ([SUPDataVault vaultExists2:@"myVault"]) {
          [SUPDataVault deleteVault:@"myVault"];
       }
    }
    @catch ( SUPDataVaultException *exception ) {
       //handle the exception
    }