Instance Method

setCredential:forProtectionSpace:

Adds a credential to the credential storage for the specified protection space.

Declaration

- (void)setCredential:(NSURLCredential *)credential forProtectionSpace:(NSURLProtectionSpace *)space;

Parameters

credential

The credential to add. If a credential with the same user name already exists in space, then credential 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 setCredential:forProtectionSpace:task:.

See Also

Adding and Removing Credentials

- removeCredential:forProtectionSpace:

Removes the specified credential from the credential storage for the specified protection space.

- removeCredential:forProtectionSpace:options:

Removes the specified credential from the credential storage for the specified protection space using the given options.

- removeCredential:forProtectionSpace:options:task:

Removes the specified credential from the credential storage for the specified protection space, on behalf of the given task and using the given options.

- setCredential:forProtectionSpace:task:

Adds a credential to the credential storage for the specified protection space, on behalf of the specified task.