Re: Adding delegate connections to NSButton
Re: Adding delegate connections to NSButton
- Subject: Re: Adding delegate connections to NSButton
- From: Ricky Sharp <email@hidden>
- Date: Mon, 2 Apr 2007 20:30:44 -0500
On Apr 2, 2007, at 7:54 PM, Mike wrote:
Actually that is not what I want to do. I have an NSView with a
checkbox in it. I don't care about getting notified when someone
clicks the checkbox because this is in a plugin with a defined
architecture in which one method in my class gets called repeatedly
by the system regardless of what I do to the code.
So each time I get called, I simply want to inspect the state of
the check box as being on or off. I have to do it in the method
that gets called by the system, not in my own message handler. It
seems absurd to me that I have to go through so many machinations
just to get one value from one control.
So then just make an outlet to the checkbox.
I am working with a copy of another plugin which has the same code
but NSTextEdit fields instead of an NSButton checkbox. I already
have code in the first plugin that gets the text of the edit
fields. Now in the second plugin I want to reuse the same code but
just access the value of the checkbox instead of the text of the
edit fields.
You should really read the docs on the classes you're working with.
APIs on one class may not be available on another, so you cannot
simply change control types and expect a clean compile.
Also, read up on MVC design patterns. I still say that eventually
you should look at a bindings solution. If you never need to work
with control actions, you'll have no code to write and your model
will be updated whenever controls change.
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden