1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Making an "unclickable" button

Discussion in 'iPhone/iPad Programming' started by Moon013, Jul 15, 2008.

  1. macrumors newbie

    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. macrumors member

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

    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. macrumors newbie

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

    So sorry about it and as well thanks.:)

Share This Page