SDWebImage UIImageView+WebCache 在 64 位设备上崩溃

2024-01-30

我有这个代码:

#import <SDWebImage/UIImageView+WebCache.h>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
[cell.thumbnail setImageWithURL:[NSURL URLWithString:thumbnailURL] placeholderImage:[UIImage animatedImageWithImages:loadingArray duration:1] options:indexPath.row == 0 ? SDWebImageRefreshCached : 0];
}

其中“loadingArray”只是一个 png 图像数组。 cellForRowAtIndexPath 显然有更多的代码。

此代码适用于 32 位设备和 32 位模拟器,但在 64 位设备和 64 位模拟器上会崩溃。

这是来自 XCode 的崩溃报告:

-[UIImageView setImageWithURL:placeholderImage:options:]: unrecognized selector sent to instance 0x110942780
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:options:]: unrecognized selector sent to instance 0x110942780'

我正在使用今天重新下载的SDWebImage-3.6框架(2014年4月22日) 清理了项目,将应用程序重新添加到模拟器中......同样的问题。

任何解决此问题的建议将不胜感激。 谢谢。


我通过将 SDWebImage 的构建设置更改为 "(armv7,arm64)" 解决了这个问题。 在“NSLog”中出现了一些错误,但这些都很容易修复,除了您需要更改以下内容之外:

- (int)getMemoryCount
{
    return [[memCache allKeys] count];
}

在 SDImageCache.m 中

- (int)getMemoryCount
{
    return (int)[[memCache allKeys] count];
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

SDWebImage UIImageView+WebCache 在 64 位设备上崩溃 的相关文章

随机推荐