Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jun 8, 2011, 10:25 PM   #1
Fritzables
macrumors regular
 
Join Date: May 2011
Location: Brisbane AUSTRALIA
[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:

Code:
NSString *returnedValue = [myPopUp titleOfSelectedItem];
Or have I missed the mark by a long shot ??

Pete
Fritzables is offline   0 Reply With Quote
Old Jun 8, 2011, 10:49 PM   #2
mfram
macrumors 6502a
 
Join Date: Jan 2010
Location: San Diego, CA USA
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:

Code:
NSString *sel = [mybutton titleOfSelectedItem];
or maybe

Code:
NSInteger sel = [mybutton indexOfSelectedItem];
... which ever is more convenient. Assuming mybutton is declared as an outlet to the button.
mfram is offline   0 Reply With Quote
Old Jun 8, 2011, 11:16 PM   #3
Fritzables
Thread Starter
macrumors regular
 
Join Date: May 2011
Location: Brisbane AUSTRALIA
Thanks mFram,

Will look at the IBOutlet tonight.
Thanks heaps.

Pete
Fritzables is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Save "gray scale" and "max contrast" via Universal Access in screen captures NeonKingKong OS X 2 Jun 2, 2013 10:09 PM
2010 27" iMac screen issue..."dirty", "cloudy", image retention issues MMcCraryNJ iMac 1 May 18, 2013 05:02 PM
My Logic "track expander tube" doesn't have "end tips" to grab! Whats up? kristenanne77 Digital Audio 3 Mar 28, 2013 09:15 AM
Resolved: Weird problem with keyboard mapping : LMP Bluetooth Keypad's "enter" seen as "CMD" DanRom iMac 2 Aug 24, 2012 01:27 AM
Start a new tab similar to "iOS blog" and "Mac blog" but make it "IPhone Leaks?" Dewroo Site and Forum Feedback 2 Aug 23, 2012 10:47 AM

Forum Jump

All times are GMT -5. The time now is 06:24 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC