のサブクラスであるペン先からセルを読み込んでいUITableViewCell
ます。
これらの各セルは、(nibファイルで)にuserInteraction
設定されてセットアップされます。YES
セルをタップすると、タップをしばらく押し続けない限り、セルの選択は表示されません(この場合は灰色)。
セル選択スタイルが表示されている場合でも、セルから指を離しても発火しませんdidSelectRowAtIndexPath:
。
前述のように、発射する唯一の方法は、セルを約3秒間押し続けることです。
なぜこれが起こっているのか誰かが知っていますか?すべてのデリゲートが正しく設定されています。また、セルをロードするデキュー方法も使用しています。
アドバイスやアドバイスをありがとう!
編集2
申し訳ありませんが、選択解除の方法を誤解しました。ここで彼らは働いています:
2012-12-28 04:20:28.120 myApp[2022:907] willSelectRowAtIndexPath: <NSIndexPath 0x1cda0400> 2 indexes [0, 0]
2012-12-28 04:20:28.130 myApp[2022:907] didSelectRowAtIndexPath: <NSIndexPath 0x1cda0400> 2 indexes [0, 0]
2012-12-28 04:20:32.166 myApp[2022:907] willSelectRowAtIndexPath: <NSIndexPath 0x1d936630> 2 indexes [1, 0]
2012-12-28 04:20:32.168 myApp[2022:907] willDeselectRowAtIndexPath: <NSIndexPath 0x1cd24770> 2 indexes [0, 0]
2012-12-28 04:20:32.171 myApp[2022:907] didDeselectRowAtIndexPath: <NSIndexPath 0x1cd24770> 2 indexes [0, 0]
2012-12-28 04:20:32.178 myApp[2022:907] didSelectRowAtIndexPath: <NSIndexPath 0x1d936630> 2 indexes [1, 0]
tableView:cellForRowAtIndexPath:
:
if (indexPath.section == 0) {
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:@"CellID"];
if (!cell) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
cell = (CustomCell *)[nib objectAtIndex:0];
}
NSArray *data = [[self.indexedData objectForKey:kIndexedDataKey] objectAtIndex:indexPath.row];
CustomObject *dataObject = [data objectAtIndex:0];
[cell setDataObject:dataObject];
return cell;
}
カスタムセルのプロパティ:
(セルの)すべてのサブビューには同じプロパティがあります。