gpt4 book ai didi

ios - 加载图像时 asyncImageView 崩溃

转载 作者:行者123 更新时间:2023-11-28 21:50:06 25 4
gpt4 key购买 nike

使用 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。

关于ios - 加载图像时 asyncImageView 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28644466/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com