• 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: NSListView "filter" a la Mail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSListView "filter" a la Mail


  • Subject: Re: NSListView "filter" a la Mail
  • From: Daniel Jalkut <email@hidden>
  • Date: Fri, 7 Feb 2003 08:43:19 -0800

Don't try to implement the functionality by directly tweaking the tableViewObjectValueForLocation.

Why don't you give your group list the ability to be "filtered." Add methods for setting a filter and for obtaining a list of "groups satisfying filter." Whenever the text changes in your "filter text" field, call the "set filter" method. At this point the group lis can cache an internal array of all the groups matching the filter. When you get called in tableViewObjectValueForLocation, call the "get filtered list" method, and use that array for your indexing relationship with the table view.


On Thursday, February 6, 2003, at 02:00 PM, Sean Gilbertson wrote:

Hello all,

I'm looking to apply a "filter"/search field that restricts what's
shown in an NSListView, like the search field in Mail.

In the NSListView.DataSource method "tableViewObjectValueForLocation,"
you can't simply return null because the ListView stops asking for
values once it receives a null. The last solution I tried was to
return the String (this is in Java) if it matched what the user is
searching for, and if the current String doesn't match, it recursively
calls "tableViewObjectValueForLocation" with the next row value. This
poses the problem that a certain match will be reported multiple times,
from the time of the last match until the time of the next match. For
example:

<code deleted>

I assume there's a more simple solution to this than the complex
algorithm(s) I'm going to arrive at with this approach. Any thoughts?

Thanks,
Sean Gilbertson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSListView "filter" a la Mail (From: Sean Gilbertson <email@hidden>)

  • Prev by Date: Re: Preferences, Authorization, Writing files
  • Next by Date: Java/Cocoa vs Java/ObjC/Cocoa vs Java/Swing
  • Previous by thread: NSListView "filter" a la Mail
  • Next by thread: ditto error
  • Index(es):
    • Date
    • Thread