使用带有 asyncImageView 的网址加载图片集时遇到崩溃问题。我得到的错误是-[__NSCFString isFileURL]: unrecognized selector sent to instance
in 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];
答案 0 :(得分:2)
我认为您使用NSString作为NSURL。