无法识别AfNetworking中的函数名称

时间:2013-12-12 18:13:33

标签: ios afnetworking

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:]:   无法识别的选择器发送到实例0xb1b71f0

     

2013-12-12 23:41:00.826申请[6749:1403] * 终止应用到期   未捕获的异常'NSInvalidArgumentException',原因:   “ - [的UIImageView   setImageWithURLRequest:placeholderImage:成功:失败:]:   无法识别的选择器发送到实例0xb1b71f0'

1 个答案:

答案 0 :(得分:0)

确保已将AFNetworking + UIImageView.m(或更可能是所有AFNetworking实施文件)添加到目标中。

单击AFNetworking + UIImageView.m,然后在右侧窗口的“目标成员资格”下选择目标。

请参阅Adding files to separate targets in Xcode 4