Making an "unclickable" button

Discussion in 'iOS Programming' started by Moon013, Jul 15, 2008.

  1. Moon013 macrumors newbie

    Jul 14, 2008
    I am currently working on a button (a UIButton type provided in Interface builder), which will turns to be "unclickable" after clicked for the first time. I expect the button to change color, informing the user that the button cannot be clicked anymore.

    Is there a way to do it? I have gone through the UIButton header file and can't seem to find a way to make that happen...

    In addition, I wanted to change the text too. The UIButton provides a variable called *_titleView. But it seems it is not the one that changes the text.
  2. grimjim macrumors member

    May 24, 2003
    Can you not simply do:
    [button setEnabled:NO];
    I haven't tried it on the device yet, but it works in the simulator.
  3. Moon013 thread starter macrumors newbie

    Jul 14, 2008
    I had written that line of code and is being put into a function which is triggered only when the button is clicked. So by right, when clicked, function triggered, the button should be made unclickable, but still it doesn't work...
  4. Moon013 thread starter macrumors newbie

    Jul 14, 2008
    Oops, I didn't link my button...Now it works!

    So sorry about it and as well thanks.:)

Share This Page