• 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: Table view active sorting and filter as model changes...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Table view active sorting and filter as model changes...


  • Subject: Re: Table view active sorting and filter as model changes...
  • From: "Shawn Erickson" <email@hidden>
  • Date: Wed, 23 May 2007 16:25:07 -0700

On 5/23/07, mmalc Crawford <email@hidden> wrote:

On May 23, 2007, at 2:03 PM, Shawn Erickson wrote:

> ...or as you state I could iterate over all participants and observe
> the key(s) that are currently in the active sort descriptor.
>
That's not *quite* what I was saying...
(The hint was supposed to be that the array controller already
observes all the elements.)

> Thinking a little more about it... subclassing NSArrayController may
> be the better way to go.
>
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context
{
        [super observeValueForKeyPath:keyPath ofObject:object change:change
context:context];
        if ([keyPath isEqualToString:FilterOrSortKey])
        {
                [self rearrangeObjects];
        }
}

Ah based on logging output I have in my participant class (implemented addObserver:forKeyPath:...) I didn't see that the array control was observing the collection of objects that it manages. After trying out the above it does apparently observe all keys (or some type of wildcard keypath?).

So now I am curious on how an NSArrayController observes the objects
it works with... any hints on that?

Thanks for the help I think I have a workable solution now.

-Shawn
_______________________________________________

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: Table view active sorting and filter as model changes...
      • From: "Shawn Erickson" <email@hidden>
References: 
 >Table view active sorting and filter as model changes... (From: "Shawn Erickson" <email@hidden>)
 >Re: Table view active sorting and filter as model changes... (From: "Shawn Erickson" <email@hidden>)
 >Re: Table view active sorting and filter as model changes... (From: "Shawn Erickson" <email@hidden>)
 >Re: Table view active sorting and filter as model changes... (From: mmalc Crawford <email@hidden>)

  • Prev by Date: Re: How do I make a singleton object AppleScriptable?
  • Next by Date: Re: Predefining number of copies for the print panel.
  • Previous by thread: Re: Table view active sorting and filter as model changes...
  • Next by thread: Re: Table view active sorting and filter as model changes...
  • Index(es):
    • Date
    • Thread