0
現在我正在使用AFNetworking 2.0
,我想將它遷移到AFNetworking 3.0
。我已經將文件添加到項目中,它顯示了很多錯誤。我檢查了migration guide。我的疑問是如何將NSURLCredential
設置爲AFNetworking 3.0.4
中的登錄請求url。我現在用的,AFNetworking 3.0遷移
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
if ([url rangeOfString:NSLoginUrl].location != NSNotFound)
{
NSURLCredential *credential = [NSURLCredential credentialWithUser:@"userName" password:@"password" persistence:NSURLCredentialPersistenceNone];
[operation setCredential:credential];
}
但AFNetworking 3
不支持AFHTTPRequestOperation
和 AFHTTPRequestOperationManager
。請幫幫我。