Re: Getting button binding to invoke an action
Re: Getting button binding to invoke an action
- Subject: Re: Getting button binding to invoke an action
- From: Keary Suska <email@hidden>
- Date: Sun, 09 Sep 2007 09:21:57 -0600
- Thread-topic: Getting button binding to invoke an action
on 9/8/07 9:01 PM, email@hidden purportedly said:
> As an experiment, I've created a Cocoa application. In the NIB file
> I have instantiated an NSObjectController, and instance of a custom
> class I want the controller to manipulate. I have connected the
> class instance to the content outlet of the NSObjectController instance.
>
> Next, I added an NSButton to the view in main window. I tried to
> create a binding such that when the button is clicked, an action
> would be called in my controlled class.
>
> I have tried binding the target for the button to the selection of
> the NSObjectController, and specifying the desired action in the
> custom class as the selector.
>
> When I run the application and click on the button, the program
> crashes with a EXC_BAD_ACCESS signal the following stack trace:
The "selection" property of NSObjectController does not return an instance
of your model class, but a proxy object that won't respond to any
non-accessor methods. Now, I can't think of why this would cause a bad
access error, but it wouldn't work anyway. Bind to the controller key
"content" instead.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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