CocoaPods UIImageView + AFNetworking.h无法识别的选择器setImageWithURLRequest [英] CocoaPods UIImageView+AFNetworking.h unrecognized selector setImageWithURLRequest

查看:161
本文介绍了CocoaPods UIImageView + AFNetworking.h无法识别的选择器setImageWithURLRequest的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode 5上安装了 AFNetworking 2.1.0 CocoaPods

I have installed AFNetworking 2.1.0 with CocoaPods on Xcode 5.

//ViewController.h
#import <AFNetworking/AFNetworking.h>
#import <AFNetworking/UIImageView+AFNetworking.h>

在UIImageview上调用 setImageWithURLRequest ,应用程序因此日志失败:

Calling setImageWithURLRequest on an UIImageview the application fail with this log:

这是错误日志:

2014-02-07 11:55:19.984 OPS[1717:60b] *** Terminating app 
due to uncaught exception'NSInvalidArgumentException', 
reason: '-[UIImageViewsetImageWithURLRequest:placeholderImage:success:failure:]: 
unrecognized selector sent to instance 0x147b06d0'

我发现了一些关于这个问题的讨论,但提供的解决方案(添加 -ObjC -all_load )在我的情况下不起作用。

I've found some discussion on this issue, but the provided solution (adding -ObjC -all_load) not working in my case.

任何想法?

谢谢

推荐答案

我遇到了与 Xcode 5 相同的问题, Cocoapods AFNetworking 1.3.3

I had the same problem with Xcode 5, Cocoapods and AFNetworking 1.3.3.

我在Google网上论坛讨论中找到了答案: AFNetworking无法识别的选择器

I found my answer in this Google Groups discussion: AFNetworking unrecognized selector


确保您的项目和目标设置不会覆盖xcconfig文件中的值。

Make sure your project and target settings aren't overwriting the values in the xcconfig file.

每个级别都应该(至少) $(继承)来继承父级的设置。

Each level should have (at least) $(inherited) to inherit the settings of the parent.

在构建设置中,确保在其他链接器标志中有 $(继承)

In Build Settings, make sure you have $(inherited) in Other Linker Flags.

在我添加 $(继承)之前构建设置(选择级别,而非组合):

Build Settings before I added $(inherited) (choose Levels, not Combined):

添加 $(继承)后的构建设置

为我修复它。

这篇关于CocoaPods UIImageView + AFNetworking.h无法识别的选择器setImageWithURLRequest的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆