View Full Version : Get selected cell value of table view

Dec 20, 2008, 04:33 AM
hi all,
i am new to iphone programming
i fill my table view with 10 rows(cell). I add four subview to cell object. Now if user select any row then we can get row of table(via indexPath.row of didSelectRowAtIndexPath method) but how can i access the selected cell and value of particular subview of cell? I know i am doing little mistake(or confuse) but i am unable to caught this mistake?

Please suggest

Dec 20, 2008, 07:04 AM
When you create the cells and add your uiviews to that cell you should tag them.

myLabel.tag = 1;

then, when you get that cell back you can use something like this to get that label back.

myLabel = (UILabel *)[cell.contentView viewWithTag:1];

Dec 20, 2008, 09:24 AM
myLabel = (UILabel *)[cell.contentView viewWithTag:1];

thanks for your reply

i already perform this task. but my problem is that how can i get cell? i am unable to get selected cell. i want to like something

TableViewCell *temp=selectedCell(or clickedCell);

here how can get selected cell(or ClickedCell)?.I know selected and clicked are different event. so one more question arise here. What event i used when user supposed to tap any cell item