Ik heb een oplossing gevonden, moeten we geloofsbrieven aan sleutelhanger gebruiker toe te voegen hier is mijn code
NSURLCredentialStorage * credentialStorage=[NSURLCredentialStorage sharedCredentialStorage]; //(1)
NSURLCredential * newCredential;
newCredential=[NSURLCredential credentialWithUser:@"myUserName" password:@"myPWD" persistence:NSURLCredentialPersistencePermanent]; //(2)
NSURLProtectionSpace * mySpaceHTTP=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPProxy realm:nil authenticationMethod:nil]; //(3)
NSURLProtectionSpace * mySpaceHTTPS=[[NSURLProtectionSpace alloc] initWithProxyHost:@"ipProxy" port:port type:NSURLProtectionSpaceHTTPSProxy realm:nil authenticationMethod:nil]; //(4)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTP]; //(5)
[credentialStorage setCredential:newCredential forProtectionSpace:mySpaceHTTPS]; //(6)
Ik herstelde eerst het sharedCredentialStorage (1), creëerde vervolgens i nieuwe NSURLCredential met mijn gebruikersnaam, wachtwoord, en het soort doorzettingsvermogen om (2) te gebruiken. Daarna maakte ik twee NSURLProtectionSpace (3) (4): een voor HTTPS Connexion en een voor HTTP Connexion
Tenslotte voegde ik NSURLCredential de sharedCredentialStorage deze ProtectionSpaces (5) (6)
Ik hoop dat deze code kunt u helpen