PDA

View Full Version : How do I change a buttons title when it is clicked?




glossywhite
Sep 1, 2009, 07:21 PM
I have forgotten how to do this, and it is frustrating - I have a single window with a single view, and I have ONE button within the view. Can someone tell me what code I would use to tell the button to change its title, when clicked?.

Also, do I need to give the button an ID?. Thanks, from a VERY confused person. :D



Catfish_Man
Sep 1, 2009, 08:05 PM
Make an IBOutlet for the button, and an IBAction for it to call when clicked; In the IBAction, call setStringValue with the new text.

glossywhite
Sep 1, 2009, 08:09 PM
Make an IBOutlet for the button, and an IBAction for it to call when clicked; In the IBAction, call setStringValue with the new text.

would you mind elaborating a bit?. thanx

`lowell`
Sep 2, 2009, 04:25 AM
I have forgotten how to do this

does this help your memory at all?

http://imgur.com/YzbKS.png

where exactly are you stuck?

rekhyt
Sep 2, 2009, 06:15 AM
does this help your memory at all?

http://imgur.com/YzbKS.png

where exactly are you stuck?

Whoa what is that program that you use to code Cocoa? I want to learn but don't know where to start. :)

glossywhite
Sep 2, 2009, 07:18 AM
does this help your memory at all?

http://imgur.com/YzbKS.png

where exactly are you stuck?

Yes that has helped tremendously!!. Thanks SO much!!.

Whoa what is that program that you use to code Cocoa? I want to learn but don't know where to start. :)

That program is Xcode my friend, and it comes on every Mac OS X DVD!