[英]Terminating app due to uncaught exception [UIImageView _isResizable]
[英]Why an I getting “Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView _isResizable]: unrecognized selector”
http://pt-br.tinypic.com/view.php?pic=300rxip&s=8#.VDhDStTF8mc
如上所示,我的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'”。 任何幫助將不勝感激。
[UITableViewCell image]
是一個不推薦使用的選擇器,系統期望它是UIImage
。 您已經覆蓋了該名稱,並返回了UIImageView
,從而使期望UIImage
的內部源失敗。
解決方案:重命名image
屬性。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.