0

セルを作成する AppDelegate に createCellForTableview: メソッドを実装しました。このメソッドは、適切な UIButton をアクセサリ ビューとしてセルに追加し、セルをコントローラに返します。

 button = (UIButton *)cell.accessoryView;
 [button setTitle:@"access" forState:UIControlStateNormal];
 [button setTitle:@"access" forState:UIControlEventTouchUpInside];
 [button addTarget:self action:@selector(accessButtonTapped:event:)  forControlEvents:UIControlEventTouchUpInside]; 

ここでの問題は、ボタン アクションが呼び出されないことです。この問題の解決を手伝ってください。

前もって感謝します

4

3 に答える 3

0

@selector を accessButtonTapped に変更します。

于 2012-06-28T11:59:36.150 に答える
0

アクセサリ ボタンの場合は、このメソッドを呼び出す必要があります。

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
于 2012-06-28T12:42:42.327 に答える