Question: I got a UIButton with style "Info Dark" set up in interface builder in my iPhone 4 app. One of the properties of the button is "Highlighted", which displays a white highlight around the button.

I would like to toggle this white highlight on and off, indicating if the button function is active or not. 

The button is linked for "Touch up inside" event in the interface builder with this callback:

```
infoButton.highlighted = !infoButton.highlighted;

```

After the first touch, the highlight disappears and does not toggle as I expect it to. What else do I need to do to make the highlight toggle and display the state of the button?

Thank you!

**Update:**
When loaded from the interface builder, the button stays highlighted, even as the view appears/disappears. What causes this to happen is the "shows touch on highlight" interface builder property. If I assign the code above to another button, the info button highlights on and off as expected. However, the touches of the info button itself interfere with the above code, causing the button to lose the **"touch" highlight**

Update 2: I added another info button, directly below the first info button, in the interface builder and made it glow permanently. To create the appearance of the toggle, I hide and unhide the glowInfoButton below the real one. This works as expected:

```
    infoButton.highlighted = NO;
    glowInfoButton.highlighted = YES;
    glowInfoButton.enabled = NO;
    glowInfoButton.hidden = YES;

- (IBAction)toggleInfoMode:(id)sender {
//    infoButton.selected = !infoButton.selected;
    glowInfoButton.hidden = !glowInfoButton.hidden;
 }

```

Answer: 
The `Highlighted` image is what displays when the UIButton is being pressed, and is controlled within the UIButton itself.

You're looking for the `Selected` property. You can set a Selected Image in IB, and then put a `infoButton.selected = !infoButton.isSelected;` in your TouchUpInside callback.
Perhaps what you really want is

```
infoButton.enabled = NO;

```

This will dim the button and disable touches when set to no, allow normal operation when set to YES.

or in your case:

```
infoButton.enabled = !infoButton.isEnabled;

```

to toggle the availability of same.

If you put this in your touchupinside event, of course it will work only the first time. After that is disabled and does not receive touch events. You would put it in another method that decides whether or not the button should be enabled.

If you truly want it to change each time it is pressed then you probably should use a switch or you may look at the -imageForState, -setTitle:forState and/or -setTitleColor:forState methods. If you want to toggle the appearance each time it is touched, you could change these.