1
votes
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'

1
Are you sure that you have a UIImageView stored in _imageView? - Erik Kerber
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
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

1 Answers

0
votes

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