我有以下AFNetworking 2代码(来自库),我尝试迁移到AFNetworking 3,但我无法理解如何执行数据任务而不是NSOperations。任何帮助,将不胜感激:将代码从AFNetworking 2迁移到3
NSURLRequest *request = [self requestWithMethod:@"GET"
path:messagePath
parameters:nil];
AFHTTPRequestOperation *operation = [self HTTPRequestOperationWithRequest:request
success:^(AFHTTPRequestOperation *_operation, id responseObject) {
if (success) {
success(responseObject);
}
}
failure:^(AFHTTPRequestOperation *_operation, NSError *error) {
NSLog(@"%@", error);
if (failure) {
failure(error);
}
}];
你有什么想说的? –
请点击此链接。 https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide –