In simple terms I have a view with three buttons;
buttonOne
buttonTwo
checkButtonStatus
if buttonOne is clicked it sets its own selected status to yes and buttonTwo selected status to no. Clicking buttonTwo does the opposite.
Both buttonOne and buttonTwo by default are not selected.
The third button (checkButtonStatus) should perform a check to make sure at least one of the other two has been clicked.
I have the code detailed below:
- (IBAction)setButtonOne:(id)sender {
buttonOne.selected = YES;
buttonTwo.selected = NO;
}
- (IBAction)setButtonTwo:(id)sender {
buttonOne.selected = NO;
buttonTwo.selected = YES;
}
- (IBAction)checkButtons:(id)sender {
if (buttonOne.selected = NO || buttonTwo.selected = NO) {
UIAlertView *callAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"You have not selected a button"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[callAlert show];
[callAlert release];
}
}
The error I'm getting is 'Lvalue required as left operand of assignment'.
I'm not a programmer, I'm a sysadmin who's been asked to prototype something and can't get it working. All help greatly appreciated.