• 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
Connecting a custom control to manipulate NSArrayController's selection.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Connecting a custom control to manipulate NSArrayController's selection.


  • Subject: Connecting a custom control to manipulate NSArrayController's selection.
  • From: Scott Andrew <email@hidden>
  • Date: Sun, 25 Mar 2007 17:57:00 -0700

I am using MUPhotoView for displaying a list of pictures. However i have a bunch of my controls that update based on the selection of the photo by connecting to the NSArrayContoller's "selection" key.

I have done the following:

[photoView bind:@"selectedPhoto" toObject:imagesToExportController withKeyPath:@"selection" options:nil];

i have then added the following:

-(NSObject*)selectedPhoto
{
	return selectedPhoto;
}

-(void)setSelectedPhoto:(NSObject*)obj
{
	[self willChangeValueForKey:@"selectedPhoto"];
	selectedPhoto = [obj retain];
	[self didChangeValueForKey:@"selectedPhoto"];
}

As my selection changes i call setSelectedPhoto. However i don't get any updates in my other controls as my selection changes. How do i update my array controller as my selection changes in the control and have it post changes to the other controls? Do i need to store the array controller and manipulate it? My total hookup looks liek the following:

// bind the photo array controller to the control.
[photoView bind:@"photosArray" toObject:imagesToExportController withKeyPath:@"arrangedObjects" options:nil];
[photoView bind:@"selectedPhotoIndexes" toObject:imagesToExportController withKeyPath:@"selectionIndexes" options:nil];
[photoView bind:@"selectedPhoto" toObject:imagesToExportController withKeyPath:@"selection" options:nil];


Thank you,
Scott Andrew
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Connecting a custom control to manipulate NSArrayController's selection.
      • From: mmalc crawford <email@hidden>
  • Prev by Date: NSStatusItem position problem
  • Next by Date: Re: NSStatusItem position problem
  • Previous by thread: Re: NSStatusItem position problem
  • Next by thread: Re: Connecting a custom control to manipulate NSArrayController's selection.
  • Index(es):
    • Date
    • Thread