gpt4 book ai didi

ios - AFNetworking 2.0 中 AFImageRequestOperation 的头文件是什么

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:08:17 24 4
gpt4 key购买 nike

我正在尝试运行这段代码:

#import "AFNetworking.h"
#import "AFHTTPRequestOperation.h"

AFImageRequestOperation *operation = [[AFImageRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject){
NSLog(@"%@", operation.responseData); // Data
NSLog(@"%@", [responseObject class]); // UIImage
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {}];

但是有这些错误:

Unknown type name AFImageRequestOperation; did you mean AFHTTPRequestOperation? Unknown receiver AFImageRequestOperation; did you mean AFHTTPRequestOperation?

最佳答案

this github issue 中所述:

Now, you'd use a regular AFHTTPRequestOperation and set its responseSerializer to an AFImageResponseSerializer object (probably [AFImageResponseSerializer serializer]).

You can read the Migration Guide to know about this whole serialization idea.

关于ios - AFNetworking 2.0 中 AFImageRequestOperation 的头文件是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21264258/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com