2015-11-06 48 views
0

我試圖添加鏈接,自定義單元格,當用戶點擊信息披露指標,應用到其它視圖依賴於細胞內容 我怎麼知道單元格的內容,如果用戶選擇加開臨客,以UIVewiTabelCell信息披露指標

+0

檢出函數'tableView(tableView:UITableView,didSelectRowAtIndexPath indexPath:NSIndexPath)'。然後你可以用'[indexPath.row]'收集關於該行的信息。在我的情況下,我的表中有一組數據。我可以像這樣訪問它:'myData [indexPath.row] .someProperty'。 – area28

+0

感謝您的幫助 –

回答

0
override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) { 
    if let cell = tableView.cellForRowAtIndexPath(indexPath) as? CustemTableViewCell { 
    // here you can access the cell and it's content 
    } 
} 
+0

自定義單元格的內容從不顯示後,我這樣做的功能 cell.myText –

+0

什麼是您的自定義單元格的類名? –

+0

CustemTableViewCell –