在使用asyncImageView加载带有url的图像集时面临崩溃问题。我收到的错误是-[__NSCFString isFileURL]: unrecognized selector sent to instance

在cellForRowAtIndexPath中

 UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MyCell"];
  #define IMAGE_VIEW_TAG 99
  if (cell==nil)
  {
    cell=[[UITableViewCell alloc]initWithFrame:CGRectZero];

    AsyncImageView *imageView = [[AsyncImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 44.0f, 44.0f)];
    imageView.contentMode = UIViewContentModeScaleAspectFill;
    imageView.clipsToBounds = YES;
    imageView.tag = IMAGE_VIEW_TAG;
    [cell addSubview:imageView];
  }
  cell.textLabel.text = [arrTweets objectAtIndex:indexPath.row];
  cell.textLabel.numberOfLines=0;
  NSString *urlString=[arrProfilePics objectAtIndex:indexPath.row];
  NSURL *url = [NSURL URLWithString:urlString];

  AsyncImageView *imageView = (AsyncImageView *)[cell viewWithTag:IMAGE_VIEW_TAG];

  [[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:imageView];
  imageView.imageURL = [arrProfilePics objectAtIndex:indexPath.row];

最佳答案

我认为您正在使用NSString作为NSURL。

09-27 07:52