• 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: NSMatrix / NSArrayController bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMatrix / NSArrayController bindings


  • Subject: Re: NSMatrix / NSArrayController bindings
  • From: Byron Wright <email@hidden>
  • Date: Wed, 27 Oct 2004 10:25:04 -0700



I figured it out, if I am not mistaken, the documentation is a little incorrect (or I am interpreting it incorrectly ) . I am doing the following to bind an NSMatrix subclass to an NSArrayController :

/* self = subclass on NSArrayController */
[myMatrix bind:@"content" toObject: self withKeyPath:@"arrangedObjects" options:nil];
[myMatrix bind:@"contentValues" toObject: self withKeyPath:@"arrangedObjects.name" options:nil];

This is the documentation on the NSMatrix bindings :

/ /---------------------------------------------------------------------- ---
http://developer.apple.com/documentation/Cocoa/Reference/ CocoaBindingsRef/BindingsText/NSMatrix.html

Value Selection Bindings
content

An NSArrayController instance that provides the content of the NSMatrix.

Unless contentValues is also bound, the titles of the items in the NSMatrix are derived by invoking description for each of the content objects.
Read-Only: Yes
/ /---------------------------------------------------------------------- ---

Reading this tells me that I must bind the content key of the NSMatrix to an NSArrayController. However, the only way I can get it to work is to bind it to the arrangedObjects key of the NSArrayController which returns an NSArray (not an NSArrayController). So I have it working but whenever I add objects to the NSArrayController I have to call "rearrangeObjects" to "touch" the controller so that the NSMatrix knows about these changes.



On Oct 27, 2004, at 3:38 AM, Steven Kramer wrote:



Op 26-okt-04 om 1:14 heeft Byron Wright het volgende geschreven:

Hi,

I am trying to programmatically bind a customer NSMatrix view with an NSArrayController and having somewhat of a hard time. I cannot seem to find any example code on doing this either. Anyone have any example code or pointers to a good resource on doing this?


Tell us a bit more. I have worked with several cell types in a bound matrix, none were very problematic. So what is the stumbling block here?

Steven

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden

This email sent to email@hidden






_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >NSMatrix / NSArrayController bindings (From: Byron Wright <email@hidden>)
 >Re: NSMatrix / NSArrayController bindings (From: Steven Kramer <email@hidden>)

  • Prev by Date: setShouldCascadeWindows: Not Working
  • Next by Date: Re: setShouldCascadeWindows: Not Working
  • Previous by thread: Re: NSMatrix / NSArrayController bindings
  • Next by thread: Re: NSMatrix / NSArrayController bindings
  • Index(es):
    • Date
    • Thread