• 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
NSMatrix of NSButtonCells prototype bindings not applied to instances in matrix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMatrix of NSButtonCells prototype bindings not applied to instances in matrix


  • Subject: NSMatrix of NSButtonCells prototype bindings not applied to instances in matrix
  • From: Ben Golding <email@hidden>
  • Date: Tue, 7 Apr 2009 12:35:53 +1000


I've been trying to create a calendar matrix of days which are clickable to select a day in the month. It's a something of a classic example of using NSMatrix from what I've read but I'm trying to use bindings to hook it up.


I am using an NSArrayController holding an array of NSButtonCell's which is connected as the NSMatrix's content. I set the bindings on the NSMatrix's NSButtonCell prototype connecting the target to my controller object (to select the day) and also the enabled attribute to the NSButtonCell's isEnabled attribute.

The NSArrayController is populated with NSButtonCell's that I create with the correct date placement, etc, using copies of NSMatrix's prototype.

When the app runs, the bindings on the button cell instances in the matrix don't seem to be observed, that is, button presses aren't forwarded to the target and the enabled attribute is ignored. If I set the bindings on the button cells within the NSMatrix directly (ie, not using the protoype), they are observed.

I don't quite get what I'm doing wrong. Should I be creating my array of button cells using something other than copy to pick up the bindings? Should I be asking the array controller to create the button cell instances? Is there something that's not working in the NSMatrix prototype? Or am I misunderstanding some concept?

Thanks,

Ben.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: NSMatrix of NSButtonCells prototype bindings not applied to instances in matrix
      • From: Ron Lue-Sang <email@hidden>
  • Prev by Date: [Moderator] Re: iPhone development
  • Next by Date: Re: Does waitUntilExit really mean that?
  • Previous by thread: [Moderator] Re: iPhone development
  • Next by thread: Re: NSMatrix of NSButtonCells prototype bindings not applied to instances in matrix
  • Index(es):
    • Date
    • Thread