how to get title of of row selected in UITableview

后端 未结 5 619
孤独总比滥情好
孤独总比滥情好 2021-02-04 03:44

I have tableview with some names on each cell , how can i get that name when select row ?

i know that i have to use delegate method

-(void)tableView:(         


        
5条回答
  •  太阳男子
    2021-02-04 04:20

    Assuming you're using a standard UITableViewCell, you can get the cell by using

    UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
    

    then access the text property view properties via:

    cell.textLabel.text
    cell.detailTextLabel.text
    

提交回复
热议问题