Get selected cell value of table view

Discussion in 'iPhone/iPad Programming' started by rup28aug, Dec 20, 2008.

  1. macrumors newbie

    Joined:
    Oct 22, 2008
    #1
    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

    Joined:
    Jun 29, 2007
    #2
    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

    Joined:
    Oct 22, 2008
    #3
    sir,
    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