Hello,
I'm new to Cocoa, and working my way through Hillegass's book. I'm having trouble with chapter 20's challenge 2.
The challenge is to add checkbox's that toggle if the letter being drawn is italic, bold, or both.
-(IBAction)toggleItalic:(id)sender
{
int state = [italicBox state];
NSLog(@"state %d", state);
if (state = 1) {
italic = YES;
NSLog(@"italic is yes");
}
else {
italic = NO;
NSLog(@"italic is no");
}
}
Right now, this snippet of code is returning yes when the box is checked, and when the box is unchecked. What am I doing wrong?
Thanks,
Justin.