• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting button binding to invoke an action
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Getting button binding to invoke an action (From: Tron Thomas <email@hidden>)

  • Prev by Date: Re: Integrating a C command line tool into Objective-C application
  • Next by Date: Re: count of a to-many relationship in an NSPredicate
  • Previous by thread: Getting button binding to invoke an action
  • Next by thread: count of a to-many relationship in an NSPredicate
  • Index(es):
    • Date
    • Thread