2014-10-10 26 views
0

http://pt-br.tinypic.com/view.php?pic=300rxip&s=8#.VDhDStTF8mc爲什麼選擇我收到「終止應用程序由於未捕獲的異常‘NSInvalidArgumentException’,原因是:「 - [UIImageView的_isResizable]:無法識別選擇」

我的UIImageView連接到TableViewCell,你可以在上面看到(我的聲譽太低而無法發佈圖片,所以我不得不將其上傳到tinypic)。

此圖片的單元代碼是在這裏:

#import <UIKit/UIKit.h> 

@interface ExtratoDeNotasSideMenuTableViewCell : UITableViewCell 

@property (strong, nonatomic) IBOutlet UIImageView *image; 
@property (strong, nonatomic) IBOutlet UILabel *label; 

@end 

之後,我指定接收其圖像:

- (ExtratoDeNotasSideMenuTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    ExtratoDeNotasSideMenuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ExtratoDeNotasSideMenuTableViewCell" forIndexPath:indexPath]; 

    // Configure the cell... 
    cell.image.image = [UIImage imageNamed:@"Icone_SideBar.png"]; 
    cell.label.text = [NSString stringWithFormat:@"%@", [self.menuItens objectAtIndex:indexPath.row]]; 

    return cell; 
} 

但它不工作,郵件: 「** *由於未捕獲異常'NSInvalidArgumentException',原因:' - [UIImageView _isResizable]:發送到實例0x7fa81356da40'「的無法識別的選擇器不斷顯示,終止應用程序。 任何幫助將不勝感激。

+0

您的單元格如何連接到屬性? – Tuan 2014-10-10 20:57:54

回答

5

[UITableViewCell image]是系統預期的不推薦使用的選擇器,它是UIImage。您已覆蓋此名稱,並返回UIImageView,使內部源預期UIImage失敗。

解決方法:重命名您的image屬性。

+0

我將我的「image」屬性重命名爲cellImage,將該屬性重新連接到imageview,現在又出現了另一個問題,我得到: 由於未捕獲的異常'NSUnknownKeyException',原因:'[ setValue:forUndefinedKey :]:這個類不是關鍵字cellImage的關鍵字編碼標準。 現在我更加困惑。 – 2014-10-10 21:08:58

+0

您是否可以更新以上來源以顯示您的更改?這可能會讓事情更清楚。 – 2014-10-14 13:32:33

相關問題