gpt4 book ai didi

ios - NSURLCredential 是永久的吗?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:20:54 25 4
gpt4 key购买 nike

我们的 iPhone 模拟器有一个问题是由于使用这条线造成的:

    Foo = [NSURLCredential CredentialWithUser:foo 
password:bar persistance:NSURLCredentialPersistencePermanent];

问题是在将凭证提供给挑战时产生的

        -(NSURLConnection *)connection
didReceiveAuthenticationChallenge(NSURLAuthenticationChallenge *)challenge
{

[[challenge sender]useCredential:Foo forAuthenticationChallenge:challenge]
}

所以现在当我们运行应用程序时,我们再也不会遇到身份验证挑战,这很奇怪,即使我们将凭据更改为

    Foo = [NSURLCredential CredentialWithUser:foo 
password:bar persistance:NSURLCredentialPersistenceForSession];

or even

Foo = [NSURLCredential CredentialWithUser:foo
password:bar persistance:NSURLCredentialPersistenceNone];

总结:

通过使用 credentialpersistencepermanent,凭据以某种方式保存在某个地方,并自动用于访问我们需要 self 验证的任何地方。

因此,出于测试目的,我们真的很想删除这个持久的...凭证。

有什么想法吗? :)

最佳答案

您是否尝试过只重置模拟器?它在模拟器菜单中。

关于ios - NSURLCredential 是永久的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6226439/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com