• 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 binding and selections
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMatrix binding and selections


  • Subject: Re: NSMatrix binding and selections
  • From: Byron Wright <email@hidden>
  • Date: Wed, 10 Nov 2004 11:51:08 -0800

thanks mmalc that's exactly what the problem was the following fixed it :

[_thumbGrid bind:@"selectedObjects" toObject: self withKeyPath:@"selectedObjects" options:bindingOptions];

Thanks for the advice, I'll most likely most the creation and binding to my app controller class.

On Nov 10, 2004, at 11:27 AM, mmalcolm crawford wrote:


On Nov 10, 2004, at 11:03 AM, Byron Wright wrote:

I am programmatically creating and binding a subclass of an NSMatrix view to an NSArrayController. I noticed that when I select cells the array controllers selection is not getting updated. What am I doing wrong?
here is the code I am using to create the binding.
- (void) buildThumbView
{
//CFCThumbView is a subclass of NSMatrix
_thumbGrid = [[CFCThumbView alloc] initWithFrame:[[_resultsView superview] frame]];
[_thumbGrid setDelegate:self];
NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary];
[bindingOptions setObject:[NSNumber numberWithBool:YES] forKey:@"NSInsertsNullPlaceholder"];
[bindingOptions setObject:[NSNumber numberWithBool:YES] forKey:@"NSRaisesForNotApplicableKeys"];
[_thumbGrid bind:@"content" toObject: self withKeyPath:@"arrangedObjects" options:bindingOptions];


You're not binding 'selected<Whatever>'...

It's also not clear to what class this code belongs. I presume this is from a subclass of NSArrayController?

[_thumbGrid bind:@"content" toObject: **self** withKeyPath:@"arrangedObjects" options:bindingOptions];

It *might* be more natural for your main window controller to set up the bindings and the matrix, and leave the array controller solely in charge of managing the matrix.

mmalc

_______________________________________________
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 binding and selections (From: Byron Wright <email@hidden>)
 >Re: NSMatrix binding and selections (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: NSMatrix binding and selections
  • Next by Date: Adding an icon to the Window title bar (like Safari does with its Locked icon)
  • Previous by thread: Re: NSMatrix binding and selections
  • Next by thread: Adding an icon to the Window title bar (like Safari does with its Locked icon)
  • Index(es):
    • Date
    • Thread