• 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: MyDocument and NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MyDocument and NSArrayController


  • Subject: Re: MyDocument and NSArrayController
  • From: email@hidden
  • Date: Mon, 10 Jan 2005 22:04:44 +0000

> I would like to set up MyDocument (subclass of NSDocument) to get
> notification of changes in an NSArrayController. Is this possible? How
> can get notif's of when the selection changes and when objects are
> added or removed from the NSArrayController?
>
> Alex
I'm doing something similar with an NSApp delegate (my project is not document based).  I set up KVC-compliant accessors to an array in my class and then created a binding to the NSArrayController's "selectedObjects" key path, like so:
 
[self bind:@"myArrayKey" toObject:theArrayController forKeyPath:@"selectedObjects" options:nil];
 
When a selection is made, my class gets an array containing the selected objects.  Since my views only allow single selections, I just pull out the first array element.
 _______________________________________________
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

  • Prev by Date: Re: ID3 tags from AAC files - still no joy
  • Next by Date: Re: Finding the selector used in calls objc_msgSend in otool output...
  • Previous by thread: MyDocument and NSArrayController
  • Next by thread: Re: MyDocument and NSArrayController
  • Index(es):
    • Date
    • Thread