Can we hide it?

Discussion in 'iOS Programming' started by arnieterm, Jan 27, 2009.

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    I want to hide a custom table view cell in an iphone application. using cell.hidden=YES; does not work. Is it really not possible to hide the cell or does there exists any alternative for hiding the cell.
    Thanks
    Arnieterm
     
  2. detz macrumors 65816

    Joined:
    Jun 29, 2007
    #2
    Explain what you're trying to do, why do you need to hide a cell?
     
  3. CommanderData macrumors regular

    Joined:
    Dec 1, 2007
    #3
    Perhaps you could return an empty or blank cell when you get to that particular index?
     
  4. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #4
    Getting an array which is bind to the data source of UITableView. There is a column named priority with an integer values of 1,2,3 etc. I need to show cells with priority values of 1 only and need to hide the others. Though an alternative is to cretae another sub array that only contains priorities with value 1. I want to avoid extra sub array so looking for hiding the cells instead

    Thanks
    Arnieterm
     
  5. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #5
    So, you're wanting to hide the entire row when the priority isn't 1?
     
  6. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #6
    Yes the entire row [cell] and not any individual control on the cell
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    I think you need to put logic into numberOfRowsInSection: and cellForRowAtIndexPath: to only populate the cell for priority 1 items then.
     
  8. Pring macrumors 6502

    Joined:
    Sep 17, 2003
    #8
    Bingo. Listen to this man :)
     
  9. CommanderData macrumors regular

    Joined:
    Dec 1, 2007
    #9
    I said the same thing yesterday in the third post, but he didn't listen then either ;)
     
  10. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #10
    Sorry, but an empty or blank cell is not the same thing as no cell at all.
     

Share This Page