Setting a Buttons title

Discussion in 'iOS Programming' started by iphonedevelop18, Mar 28, 2009.

  1. iphonedevelop18 macrumors member

    Joined:
    Feb 26, 2009
    #1
    Sorry for the noob question but I cannot figure out how to set a Buttons text
    I tried using "button.text" and "button.title."

    Thanks
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
    Did you try looking at the class reference for UIButton? Especially around the setTitle instance methods?
     
  3. iphonedevelop18 thread starter macrumors member

    Joined:
    Feb 26, 2009
    #3
    yes, i made sure to look at those thoroughly before posting and I didnt see it.
     
  4. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #4
    so you didn't see setTitle: forState:? hmmm you obviously weren't looking very hard. Anyway its used like [<nameOfButton> setTitle:mad:"Whatever" forState:UIControlStateNormal]; if you want to set the title of the button in general
     

Share This Page