1
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{

NSURL *url=[NSURL URLWithString:share.profilePicUrl];

  [_imageview setImageWithURLRequest:[NSURLRequest requestWithURL:url] placeholderImage:

[UIImage imageNamed:@""] success:^(NSURLRequest *request,NSHTTPURLResponse *response,UIImage *image)
         {

             dispatch_async(dispatch_get_main_queue(), ^{

                    _imageview.image = image;

             });

         } failure:^(NSURLRequest *request,NSHTTPURLResponse *response,NSError *error){

         }];
    });

UIImageView setImageWithURLRequest:placeholderImage:success:failure:]: unrecognized selector sent to instance 0xb1b71f0

2013-12-12 23:41:00.826 Application[6749:1403] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURLRequest:placeholderImage:success:failure:]: unrecognized selector sent to instance 0xb1b71f0'

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
Ankur
  • 98
  • 2
  • 13
  • Are you sure that you have a UIImageView stored in _imageView? – Erik Kerber Dec 12 '13 at 18:29
  • Could you provide a bit more information on your setup? Is _imageView an instance of UIImageView, and are you including the UIImageView+AFNetworking category provided by AFNetworking somewhere where _imageView could adopt the setImageWithURLRequest:placeholderImage:success:failure method? – rambo Dec 12 '13 at 18:31
  • Did you add AFNetworking as Cocoa Pod or as AFNetworking.framework? In any case, make sure the binaries (.a or .framework) are added in the Copy Phase – Adam Mendoza Sep 17 '16 at 21:59

1 Answers1

0

Ensure that AFNetworking+UIImageView.m (or more likely, all AFNetworking implementation files) has been added to your target.

Click on AFNetworking+UIImageView.m, and select your target under "Target Membership" in the right window.

See Adding files to separate targets in Xcode 4

Community
  • 1
  • 1
Erik Kerber
  • 5,646
  • 7
  • 38
  • 56