• 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
Bindings with a custom view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bindings with a custom view


  • Subject: Bindings with a custom view
  • From: Steve Israelson <email@hidden>
  • Date: Wed, 27 Jun 2007 15:27:04 -0700

I have made a custom view that can show a list of items in a grid like view.
I also have a view of the same list in a table.
I have an NSArrayController bound to both views.


When I make a selection in the NSTableView, I correctly see that same selection in my grid like view.
When I make a selection in my custom view, the NSTableView does NOT mirror the selection.
It seems like the binding for the selected indexes is not working for my custom view.
I can't see why though.
I looked at the KVC docs on ensuring compliance and I think I am compliant.


Is there anything I am missing?

The relevant code is:

@interface PhotoGridView : NSView
{
NSIndexSet *selectedPhotoIndexes;
}
- (NSIndexSet *)selectedPhotoIndexes;
- (void)setSelectedPhotoIndexes:(NSIndexSet *)inSet;
@end

@implementation PhotoGridView
+ (void)initialize;
	{
    [self exposeBinding:@"selectedPhotoIndexes"];
	}
- (NSIndexSet *)selectedPhotoIndexes;
	{
	return selectedPhotoIndexes;
	}
- (void)setSelectedPhotoIndexes:(NSIndexSet *)inSet;
	{
	[selectedPhotoIndexes release];
	selectedPhotoIndexes = [inSet copy];
	[self setNeedsDisplay:YES];
	}
@end
_______________________________________________

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: Bindings with a custom view
      • From: Ricky Sharp <email@hidden>
    • Re: Bindings with a custom view
      • From: mmalc Crawford <email@hidden>
  • Prev by Date: Re: Guidance for learner
  • Next by Date: Re: Bindings with a custom view
  • Previous by thread: Re: Dictionaries vs iVars
  • Next by thread: Re: Bindings with a custom view
  • Index(es):
    • Date
    • Thread