0
我有一個自定義單元格,它上面有一個按鈕。我想嘗試用長按來代替。自定義表格單元格,自定義XIB和長按識別器 - 不能使它們一起工作
創建單元格中的代碼如下所示:
CustomCell *cell = (CustomCell *)[aTableView dequeueReusableCellWithIdentifier:@"CustomCell"];
if (!cell)
{
cell = [[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil] lastObject];
}
(ETC)
所以我這樣做:
CustomCell *cell = (CustomCell *)[aTableView dequeueReusableCellWithIdentifier:@"CustomCell"];
if (!cell)
{
// cell = [[[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil] lastObject];
cell = [[[NSBundle mainBundle] loadNibNamed:@"CustomCellDwellToSpeak" owner:self options:nil] lastObject];
}
然後我做了原有的廈門國際銀行的副本。刪除了該按鈕。投下了UILongPressGestureRecognizer的細胞,並通過控制拖動窗體創建一個目標識別該文件的所有者:
- (IBAction)longPress:(UILongPressGestureRecognizer *)sender;
但是,一旦我開始產生細胞,我得到這個錯誤:
TypOHD[41541:c07] -[UILongPressGestureRecognizer label]: unrecognized selector sent to instance 0x17d0be60
這是怎麼回事?