I'm working through the tutorials in the "Beginning iPhone Development" book. I'm on chapter 4 and I'm getting the following compile error on the "if (segment == kShowSegmentIndex)" line:
error:expected ')' before ';' token
Here's my code:
- (IBAction)toggleShowHide:(id)sender{
UISegmentedControl *segmentedControl = (UISegmentedControl *)sender;
NSInteger segment = segmentedControl.selectedSegmentIndex;
if (segment == kShowSegmentIndex) [switchView setHidden:NO];
else [switchView setHidden:YES];
}
I've compared it with the code in the book several times and have retyped it. Sounds like this error is caused by improper brace placement. Any thoughts?