• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSComboBoxCell will not select
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSComboBoxCell will not select


  • Subject: Re: NSComboBoxCell will not select
  • From: Ivan C Myrvold <email@hidden>
  • Date: Wed, 27 Feb 2008 14:04:06 +0100

I found out at last that I had to set my class to be a data source, and implement outlineView:setObjectValue:forTableColumn:byItem:
I still uses binding to bind the values of the cells, but it looks like I in addition to that have to implement this method, to get it working.
If not anyone have a better idea.


Ivan

Den 27. feb.. 2008 kl. 12:23 skrev Ivan C Myrvold:

I have problem with making a NSComboBoxCell keep the value selected. Here is what I am doing:

I have an NSOutlineView, where the last column (Change To) is binded to an NSTreeController (Value TreeController.arrangedObjects.c).
Some of the values in this column can have two or more values in a row, so I have a method to replace the NSTextFieldCell with an NSComboBoxCell when I have such
a value.


When I try to select a value in the combo box, as displayed here with "spokeswoman":
http://www.myrvold.org/cocoa/comboBeforeSelect.jpg


I can see for a fraction of a second the new value "spokeswoman", before it immediately changes back to the old value "spokesman":
http://www.myrvold.org/cocoa/comboAfterSelect.jpg


If I however doubleclicks in the combo box, and writes in a new word, like this:
http://www.myrvold.org/cocoa/comboBeforeEnter.jpg


Then the new text sticks:
http://www.myrvold.org/cocoa/comboAfterEnter.jpg

If I use NSLog to see the indexOfSelectedItem of the combo box, it is always -1.

Any ideas why the combo box cell have this behaviour?

Ivan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSComboBoxCell will not select (From: Ivan C Myrvold <email@hidden>)

  • Prev by Date: Re: Help with PDFPage to NSImage
  • Next by Date: Re: Help with PDFPage to NSImage
  • Previous by thread: NSComboBoxCell will not select
  • Next by thread: Setting iTunes album art with ScriptingBridge
  • Index(es):
    • Date
    • Thread