• 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
Q: show/hide in NSTableView--use NSFilter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Q: show/hide in NSTableView--use NSFilter?


  • Subject: Q: show/hide in NSTableView--use NSFilter?
  • From: Leonard Budney <email@hidden>
  • Date: Sun, 22 May 2005 13:32:51 -0400

Hello,

I'm implementing an NSTableView with a column of checkboxes, and a preference to show/hide checked items.

I've already done that using two mutable arrays: one bound to the table view, and one to hold "hidden" items. When the KVO sees this preference change, items are moved from the main array to the hidden array and vice versa. This seems consistent with postings I've seen on this list.

My question is, shouldn't I be using NSPredicate and asking the array controller to filter the entries? The documentation hints that NSPredicate is for use in implementing search, which I plan to do soon. In addition, I plan to add other show/hide options, for example hiding items whose "value" attribute is below a certain threshold. The logic to show and hide items could become fairly complex as options are added...

I'm thinking that perhaps I want to create an NSCompoundPredicate that performs an AND on the various conditions: "display" column checked; "value" above threshold; meets search criteria; etc.

Does that seem like the right thing to be doing? I would have to save the predicate with the file, since some of the predicates are driven by preferences.

Thanks!
Len.


_______________________________________________ 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
  • Follow-Ups:
    • Re: Q: show/hide in NSTableView--use NSFilter?
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Creating an Offscreen NSView
  • Next by Date: Re: Q: show/hide in NSTableView--use NSFilter?
  • Previous by thread: menuBarHeight instance method?
  • Next by thread: Re: Q: show/hide in NSTableView--use NSFilter?
  • Index(es):
    • Date
    • Thread