NSComboBox in NSTableView behaving strangely

Discussion in 'Mac Programming' started by Monaj, Jul 4, 2011.

  1. macrumors regular

    Joined:
    May 24, 2009
    #1
    Hi All,

    I am trying a sample application, which enlists some entities to purchase and their respective cost.

    In data model I created two entities:

    1. Daily Transaction (Attribute: cost, Relationship: relatedEntity)
    2. Entity (Attribute: name, Relationship: dailyTransactions)

    Controls used in XIBs and their bindings:

    I. ArrayControllers -

    a. DailyTransactions, corresponding to **Daily Transaction** entity.

    b. Entities, corresponding to **Entity** entity


    II. A table -

    Col 1: EntityName - NSComboBoxCell (value : bind to -> dailyTransactions, controller key -> arrangedObjects, model key path -> relatedEntity.name)

    Col 2: EntityCost - NSTextFieldCell with NSNumberFormatter (value : bind to -> dailyTransactions, controller key -> arrangedObjects, model key path -> cost)

    » NSComboBoxCell in EntityName (content values : bind to -> Entities, controller key -> arrangedObjects, model key path -> name)

    Problem is -

    When I am selecting a value in dropdown list of combobox cell, it is changing the value of previously selected value to newly selected value, as shown in below figure(s) -

    Original list:

    [​IMG]

    Changed list:

    [​IMG]

    Can anyone suggest me how to resolve it?

    Thanks,

    Monaj
     

Share This Page