2011-02-28 22 views

回答

6

用於此目的

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath 

該火災時,你在附件單擊

+0

我做到了,但沒有工作。 – Nitin 2011-02-28 05:26:56

+0

當您在選擇行時需要兩個不同的動作時,您需要使用此方法並使用DetailDisclosureButton。 – Ishu 2011-02-28 05:29:48

+0

最後它的工作現在thanx。 – Nitin 2011-02-28 05:34:04

9

你需要定義單元格的accessoryType

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 

這樣

此委託方法
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; 

這個accessoryType的行選擇的方法是

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath 

,但如果要定義任何其他accessoryType細胞比你可以用這個方法。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
相關問題