Darkroom
Jul 22, 2009, 07:57 PM
on screen i have 2 buttons. when they are tapped, they become highlighted. i'm trying to make it so that only one button can be highlighted at once.
- (void)viewDidLoad
{
NSMutableArray *aHighlightsArray = [[NSMutableArray alloc] initWithObjects: buttonHighlight1, buttonHighlight2, nil];
self.highlightsArray = aHighlightsArray;
[aHighlightsArray release];
}
- (IBAction)menuTouchDown:(id)sender
{
for (id Objects in highlightsArray)
if ([Objects alpha] == 0.0)
[self highlightPressedButton:sender]
}
the above snippet evaluates all objects in the highlightsArray. if all of them have a zero alpha (IE no button has been tapped), it will highlight the sender button. but even with this code when one button is highlighted i can still press the other button and have them both highlighted. this code commands to only goto highlightPressedButton:sender if all highlights are currently of zero alpha!
any thoughts?
- (void)viewDidLoad
{
NSMutableArray *aHighlightsArray = [[NSMutableArray alloc] initWithObjects: buttonHighlight1, buttonHighlight2, nil];
self.highlightsArray = aHighlightsArray;
[aHighlightsArray release];
}
- (IBAction)menuTouchDown:(id)sender
{
for (id Objects in highlightsArray)
if ([Objects alpha] == 0.0)
[self highlightPressedButton:sender]
}
the above snippet evaluates all objects in the highlightsArray. if all of them have a zero alpha (IE no button has been tapped), it will highlight the sender button. but even with this code when one button is highlighted i can still press the other button and have them both highlighted. this code commands to only goto highlightPressedButton:sender if all highlights are currently of zero alpha!
any thoughts?
