Getting name of selected item from NSPopUpButton in Cocoa Mac

By | March 16, 2011

Hi,

On many occasions you may need to use a popup button & in cocoa mac you can use NSPopUpButton objects for the same.
While using a pop up button we need to identify the name of the item selected from the pop up list. But how is that done?
You can use the following code for do the same.

NSPopUpButtonCell *nameHere = [sender selectedCell];

nameHere contains the name of your selected item from the NSPopUpButton.
🙂

Leave a Reply

Your email address will not be published. Required fields are marked *