CocoaPods UIImageView + AFNetworking.h unrecognized selectImageWithURLRequest selector

I installed AFNetworking 2.1.0 with CocoaPods on Xcode 5.

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

Calling setImageWithURLRequest in a UIImageview application crashes with this log:

This is the error 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' 

I found some discussion of this problem, but the solution provided (adding -ObjC -all_load ) does not work in my case.

Any idea?

thanks

+7
ios cocoapods xcode5 afnetworking objective-c-category
source share
3 answers

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

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

Make sure your project settings and goals do not overwrite the values ​​in the xcconfig file.

Each level must have (at least) $ (inherited) in order to inherit the parent settings.

In the build settings, make sure you have $(inherited) in the other linker flags.

Adjust the settings before adding $(inherited) (select "Levels, Not Combined"):

Other Linker Flags without $ (inherited)

Build settings after adding $(inherited) :

Other Linker Flags with $ (inherited)

This fixed it for me.

+26
source share

I had the same problem and the above solutions did not fix it. It was a stupid mistake. I included only .h instead of both .h and .m

0
source share

Check out the PodFile file. Maybe this is the setup instlalation "pod 'AFNetworking', '~> 3.0'" for another purpose.

-one
source share

All Articles