iOS5: willSendRequestForAuthenticationChallenge method is running recursive

后端 未结 2 348
旧巷少年郎
旧巷少年郎 2021-01-19 05:09

I am using the below code for authentication of the user with the remote server.If I am giving correct username and password, there is no issue because authentication is hap

2条回答
  •  温柔的废话
    2021-01-19 05:59

    You need to check the error count and cancel the authentication challenge appropriately:

    if ([challenge previousFailureCount]) {
        [[challenge sender] cancelAuthenticationChallenge:challenge];
    } else {
        [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
    }
    

提交回复
热议问题