Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How do I get a variable for a radio button?

How do I get a variable for a radio button?
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 29, 2001, 10:41 PM
 
I am a total newbie to everything Cocoa. I don't have a book on C yet although C Primer Plus just shipped. I don't have Learning Cocoa although it is on order. My last language was Fortran. I have successfully completed the CurrencyConverter tutorial.

As a second project I just wanted to convert the CurrencyConvert into a simple calculator that would take the numbers in the two fields and perform the function designated by a radio button (add, subtract, multiply, divide).

I set up an ArithmeticController object to interact with the interface and to call the appropriate arithmetic model object (I took the Model-Controller bit pretty seriously ). I have four model objects; one for each function.

That is the background. The question is, how do I determine which radio button is selected? I have set up a case routine and just want to evaluate the radio button selection. Do I have to 'connect' the ArithmeticController to the radio buttons and make an 'outlet' for the radio buttons in the ArithemeticController object?

Please excuse my ignorance as I am just getting started with OOP and PB/IB.

Thanks,
kman
     
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status: Offline
Reply With Quote
May 30, 2001, 08:28 AM
 
Check out the SimpleCocoaApp source, I think going through the code may help you with radio button questions:
http://developer.apple.com/samplecod...leCocoaApp.htm


iMac 17" G4 800MHZ & 768 SDRAM
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 30, 2001, 08:39 AM
 
Thanks. I hadn't run across that tutorial yet. I'll give it a whirl tonight.
kman
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:07 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2