'AFHTTPSessionManager' 没有可见的@interface 声明了选择器 'dataTaskWithRequest:completionHandler:'
No visible @interface for 'AFHTTPSessionManager' declares the selector 'dataTaskWithRequest:completionHandler:'
刚才我把AFNetworkig更新到4.0了。我收到了这个错误。如何解决这个错误?
这是我的代码
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] init];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/xml"];
NSURLSessionDataTask *task = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
NSDictionary *responses = [XMLReader dictionaryForXMLData:responseObject error:nil];
BOLog(@"responsess%@",responses);
block(responses,nil);
}];
[task resume];
NSURLSessionDataTask *task = [manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
NSDictionary *responses = [XMLReader dictionaryForXMLData:responseObject error:nil];
BOLog(@"responsess%@",responses);
block(responses,nil);
}];
[task resume];
刚才我把AFNetworkig更新到4.0了。我收到了这个错误。如何解决这个错误? 这是我的代码
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] init];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.responseSerializer.acceptableContentTypes = [manager.responseSerializer.acceptableContentTypes setByAddingObject:@"text/xml"];
NSURLSessionDataTask *task = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
NSDictionary *responses = [XMLReader dictionaryForXMLData:responseObject error:nil];
BOLog(@"responsess%@",responses);
block(responses,nil);
}];
[task resume];
NSURLSessionDataTask *task = [manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
NSDictionary *responses = [XMLReader dictionaryForXMLData:responseObject error:nil];
BOLog(@"responsess%@",responses);
block(responses,nil);
}];
[task resume];