• 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: Thu, 24 May 2007 14:16:28 -0700

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

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

> On 5/23/07, Shawn Erickson <email@hidden> wrote:
>> So I subclassed NSArrayController and implement the following. I now
>> have the behavior I want.
>
> Actually ... I take it back it isn't working as I want. It looks like
> the array controllers only observe its current selection (or selected
> objects) and I believe only for keys that have view objects bound to
> selection.<somekey>.
>
Oh, heavens, I'm sorry; somehow after I wrote:

"The problem, though, is that in general the table view won't know how
a model has changed.  Although what you're proposing may be reasonable
if, say, someone changes a value in a detail field or if a value is
changed by an Apple Script, what happens when a user edits a value in
a table view that causes the row to be re-sorted or worse removed...?"

I got it into my head that in your case the only row being affected
would be the one the user is currently editing.

No worries.

Given your actual circumstances there are several approaches, but they
basically boil down to, yes, you'll have to observe the content
objects, somehow.

Thanks for confirming what I was seeing. :)

The cost of observation isn't particularly high, but there are some
things you could do to reduce the overhead of registration, in
particular you could provide a single key that's dependent on all the
keys that affect sorting and filtering and observe only that -- the
GraphicsBindings example at <http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
 > gives an example.

I will take a look and give it some thought.

There are perhaps a couple of other things you could do, but I want to
do a little more investigation before suggesting anything more
radical...

Thanks for your assistance so far.

-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


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

  • Prev by Date: Re: How to draw a rectangle around a (graph) view?
  • Next by Date: Re: How to draw a rectangle around a (graph) view?
  • Previous by thread: Re: Table view active sorting and filter as model changes...
  • Next by thread: releasing NSProgressIndicator
  • Index(es):
    • Date
    • Thread