2014-04-22 37 views
2

我有這樣的代碼:SDWebImage的UIImageView +崩潰的WebCache在64個設備

#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日) 清理的項目,重新添加應用程序到仿真器。同樣的問題。

任何建議來解決這個問題將不勝感激。 謝謝。

+0

嗯,它看起來像去除SDWebImage框架並手動添加.h和.m文件到項目中解決了問題。 – TooManyEduardos

回答

0

我已經通過將SDWebImage的Build設置更改爲「(armv7,arm64)」來解決此問題。 得到了在「的NSLog」了一些錯誤,但這些都是很容易修復,除了你需要改變以下事實:

- (int)getMemoryCount 
{ 
    return [[memCache allKeys] count]; 
} 
在SDImageCache.m

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

你是怎麼做到的 - 改變框架的構建設置? – Petar