How do I change a buttons title when it is clicked?

Discussion in 'Mac Programming' started by glossywhite, Sep 1, 2009.

  1. glossywhite macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #1
    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
     
  2. Catfish_Man macrumors 68030

    Catfish_Man

    Joined:
    Sep 13, 2001
    Location:
    Portland, OR
    #2
    Make an IBOutlet for the button, and an IBAction for it to call when clicked; In the IBAction, call setStringValue with the new text.
     
  3. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #3
    would you mind elaborating a bit?. thanx
     
  4. `lowell` macrumors newbie

    Joined:
    Aug 20, 2009
    Location:
    San Diego
    #4
    does this help your memory at all?

    [​IMG]

    where exactly are you stuck?
     
  5. rekhyt macrumors 65816

    Joined:
    Jun 20, 2008
    Location:
    Part of the old MR guard.
    #5
    Whoa what is that program that you use to code Cocoa? I want to learn but don't know where to start. :)
     
  6. glossywhite thread starter macrumors 65816

    glossywhite

    Joined:
    Feb 28, 2008
    #6
    Yes that has helped tremendously!!. Thanks SO much!!.

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

Share This Page