How to set row height based on its content in table

Discussion in 'Mac Programming' started by Monaj, Jul 5, 2010.

  1. Monaj macrumors regular

    Joined:
    May 24, 2009
    #1
    Hi all,

    Generally, table has a fixed row height but according to my requirements I need to set height of each row according to content within it.

    Can anyone suggest me some solution for it?

    Thanks,

    Monaj
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    There is no way without subclassing NSTableView and overriding quite a few methods. You can save some time by using an existing implementation
     
  3. Peter Maurer macrumors member

    Joined:
    Oct 9, 2008
    #3
    I may be missing the point here, but doesn't [NSTableViewDelegate tableView:heightOfRow:] (available since Mac OS X 10.4) do exactly what Monaj is asking for?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Yes it would appear to :)
     

Share This Page