NSComboBox - How to know item selected or not

Discussion in 'Mac Programming' started by satyam90, Jan 8, 2008.

  1. satyam90 macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #1
    I am using Obj C with Cocoa Frame work.
    I have a NSComboBox in my application where I am populating the contents using the method "addItemWithObjectValue" in awakeFromNib. I am adding 5 entries to the combo box. Its working fine. But I can see the entries only when I click on the combo box for selection. By default no entry is shown and selected.
    If we can't show any default value in combo box, how to validate whether any value is selected or not?

    Is there any solution for this?
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Just select the first item as the default item using selectItemAtIndex:0
     
  3. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London

Share This Page