Get selected cell value of table view

Discussion in 'iOS Programming' started by rup28aug, Dec 20, 2008.

  1. macrumors newbie

    Oct 22, 2008
    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
  2. macrumors 65816

    Jun 29, 2007
    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];
  3. thread starter macrumors newbie

    Oct 22, 2008
    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

Share This Page