• 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: mmalc Crawford <email@hidden>
  • Date: Thu, 24 May 2007 12:33:31 -0700


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.

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

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.

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...

mmalc

_______________________________________________

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>)
 >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>)

  • Prev by Date: Re: NSImage quality, blurred characters
  • Next by Date: Encoding function pointer in an NSValue
  • 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