Guest User

Untitled

a guest
Jun 26th, 2018
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. -(void)connection:(NSURLConnection *)aConnection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
  2. if ([challenge previousFailureCount] == 0) {
  3. NSURLCredential *newCredential;
  4. newCredential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];
  5. [[challenge sender] useCredential:newCredential forAuthenticationChallenge:challenge];
  6. } else {
  7. [[challenge sender] cancelAuthenticationChallenge:challenge];
  8. }
  9. }
Add Comment
Please, Sign In to add comment