nstableview question

Discussion in 'Mac Programming' started by sgthree, Apr 10, 2012.

  1. sgthree macrumors newbie

    Feb 10, 2012
    I have a core data entity that keeps track of payments and receipts. It has (inter alia) two attributes, debitAmount and creditAmount. One of these contains a value, the other is always zero.

    entities are displayed using an NSTableView through an array controller and bindings. The tableview has two columns, one debit, the other credit. Number formatters ensure that the numbers display as currency.

    How to I get the tableview to leave a cell blank when the value is 0? It currently insists on showing $0.00 or just $0 when the value is 0.
  2. knightlie, Apr 11, 2012
    Last edited: Apr 11, 2012

    knightlie macrumors 6502a

    Feb 18, 2008
    - Drag a Number formatter onto the columns cell;
    - Set the formatters Behaviour to Mac OS X 10.4+ Custom;
    - Near the bottom of the Inspector is a scroll view of options, change Zero Symbol to "-" or whatever you need.
  3. sgthree thread starter macrumors newbie

    Feb 10, 2012
    thank you very much.

    I had seen that scroll view, but it only displayed the top 4 items, and as is the case with Lion, the absence of scroll bars gives you no clues that there are further items in the list to choose from. I think it is about time I turned them on permanently!!
  4. knightlie macrumors 6502a

    Feb 18, 2008
    I have yet to upgrade to Lion, but I had already figured that the new scroll bars were fatally flawed. Good idea to make them permanently visible as they should be.

Share This Page