gpt4 book ai didi

ios - AFNetworking 2.0 中的 setImageWithURL

转载 作者:行者123 更新时间:2023-11-28 19:52:43 25 4
gpt4 key购买 nike

AFNetworking 1.x 中,我们可以像这样使用 setImageWithURL:

NSURL* imageURL = [api urlForImageWithId:IdPhoto isThumb:NO];
[photoView setImageWithURL: imageURL];
}

其中 IdPhoto 是我要加载到 ImageView 中的照片的 ID。

此代码在 AFNetworking 2.0 中不起作用。我想我必须以某种方式使用 AFImageResponseSerializer,但无法弄清楚如何编写代码。

谢谢

最佳答案

要使此代码有效,您需要导入 <UIImageView+AFNetworking.h>

关于ios - AFNetworking 2.0 中的 setImageWithURL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28199745/

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