|Jun 8, 2011, 09:25 PM||#1|
[NSPopUpButton] "titleOfSelectedItem" ??
Hi to All,
As some of you are aware, I am in my very early stages of developping for Mac after leaving Windows to take up with Mac. I still have a lot to learn and enjoying the new skills.
My question is. If I have created an object of NSPopUpButton and called it myPopUp (in this example).
In it's simplessed form, would I return the string of the selected item like this:
NSString *returnedValue = [myPopUp titleOfSelectedItem];
|Jun 8, 2011, 09:49 PM||#2|
Well, probably the more standard way to do it is to create a Pop Up button by dragging it to your window in Interface Builder. Then create an outlet to the button in whatever controller you want.
Then yes, you should be able to call:
NSString *sel = [mybutton titleOfSelectedItem];
NSInteger sel = [mybutton indexOfSelectedItem];
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|NSPopUpButton binding question||Spraystarch||Mac Programming||2||Jul 27, 2008 08:52 AM|
|NSPopupButton bindings with NSArrayController||satyam90||Mac Programming||1||Jun 12, 2008 06:12 AM|
|How to set the first entry in NSPopUpButton||satyam90||Mac Programming||3||Feb 4, 2008 11:24 AM|
|Control NSArrayController Selection with NSPopUpButton?||stadidas||Mac Programming||7||Jan 27, 2008 10:58 AM|
|NSPopUpButton vs. Cocoa Bindings Error||HiRez||Mac Programming||3||Mar 10, 2006 05:21 AM|
All times are GMT -5. The time now is 08:52 AM.