Adds a credential to the credential storage for the specified protection space.
SDKs
- iOS 2.0+
- macOS 10.2+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
- (void)setCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtection Space *)space;
Parameters
credential
The credential to add. If a credential with the same user name already exists in
space
, thencredential
replaces the existing object.space
The protection space to which to add the credential.
Discussion
If the credential is not yet in the set for the protection space, it will be added to it.
If you override this method, also override set
.