Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS AFNetworking在何处放置setWillSendRequestForAuthenticationChallengeBlock on操作_Ios_Afnetworking - Fatal编程技术网

iOS AFNetworking在何处放置setWillSendRequestForAuthenticationChallengeBlock on操作

iOS AFNetworking在何处放置setWillSendRequestForAuthenticationChallengeBlock on操作,ios,afnetworking,Ios,Afnetworking,im使用AFNetworking 2,如何设置setWillSendRequestForAuthenticationChallengeBlock以在质询时发送证书 NSString *url = [NSString stringWithFormat:@"%@%@", API_URL_ROOTV1, API_URL_HUBA]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithStri

im使用AFNetworking 2,如何设置setWillSendRequestForAuthenticationChallengeBlock以在质询时发送证书

NSString *url = [NSString stringWithFormat:@"%@%@", API_URL_ROOTV1, API_URL_HUBA];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
[request setHTTPMethod:@"GET"];

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation setWillSendRequestForAuthenticationChallengeBlock:^(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge) {

}];

[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {

} failure:^(AFHTTPRequestOperation *operation, NSError *error) {

}];

[operation start];
在我试图调用
setWillSendRequestForAuthenticationChallengeBlock
的文件中:

我知道cocoapods已经在Pods-prefix.pch中定义了#define,不希望再次定义它

它可能会帮助你

#define _AFNETWORKING_PIN_SSL_CERTIFICATES_