Is it possible to bind buttons to an NSView and its variables? I've been trying for the past 4hrs, but I'm getting no where.
Background: I'm going through Cocoa Programming For Mac OS X Third Edition. The challenge is as follows: "Add the Boolean variables bold and italic to your BigLetterView. Add check boxes that toggle these variables. If bold is YES, make the letter appear in boldface; if italic is YES, make the letter appear in italics."
My problem arises from linking the bold and italic variables to the checkboxes. I've been trying through the Interface Builder by clicking on the checkbox (i.e. the bold checkbox) and then going to the Button Bindings in the Inspector. When I go to the Value section the view doesn't show up in the Bind to drop-down box.
If I create an object of the view it shows up in the Bind to drop-down box, but I now have two objects so toggle the button doesn't do anything to the other object. I've tried finding a way to link the objects, but couldn't find anything. I assumed from the start that this wasn't the way, but I've been trying anything.
I've confirmed that creating IBOutlet NSButton works, but that's not what the question is asking. By going through it in this manner, I can get the application working correctly, but obviously not using the boolean variables.
I'm not sure if any code is necessary since I assume the problem and solution will be found in the Interface Builder. If a screenshot of the Interface Builder or any code is necessary please ask and I'll post them right away. I'll refrain from posting them now so as to not clutter the topic with potentially wasteful information.
I appreciate any help.
edit: In my frustration I didn't even think of uploading a zip of the code. Warning, in the Interface Builder there are a few errors since I was fooling around. They aren't critical, but if I remove them they remove functionality like quiting, etc so I just left the errors there. Like stated above, I'm just trying to figure out a way to link the boolean variables in BigLetterView to the checkbox bindings.
Code
Background: I'm going through Cocoa Programming For Mac OS X Third Edition. The challenge is as follows: "Add the Boolean variables bold and italic to your BigLetterView. Add check boxes that toggle these variables. If bold is YES, make the letter appear in boldface; if italic is YES, make the letter appear in italics."
My problem arises from linking the bold and italic variables to the checkboxes. I've been trying through the Interface Builder by clicking on the checkbox (i.e. the bold checkbox) and then going to the Button Bindings in the Inspector. When I go to the Value section the view doesn't show up in the Bind to drop-down box.
If I create an object of the view it shows up in the Bind to drop-down box, but I now have two objects so toggle the button doesn't do anything to the other object. I've tried finding a way to link the objects, but couldn't find anything. I assumed from the start that this wasn't the way, but I've been trying anything.
I've confirmed that creating IBOutlet NSButton works, but that's not what the question is asking. By going through it in this manner, I can get the application working correctly, but obviously not using the boolean variables.
I'm not sure if any code is necessary since I assume the problem and solution will be found in the Interface Builder. If a screenshot of the Interface Builder or any code is necessary please ask and I'll post them right away. I'll refrain from posting them now so as to not clutter the topic with potentially wasteful information.
I appreciate any help.
edit: In my frustration I didn't even think of uploading a zip of the code. Warning, in the Interface Builder there are a few errors since I was fooling around. They aren't critical, but if I remove them they remove functionality like quiting, etc so I just left the errors there. Like stated above, I'm just trying to figure out a way to link the boolean variables in BigLetterView to the checkbox bindings.
Code