Re: Instant smooth searching
Re: Instant smooth searching
- Subject: Re: Instant smooth searching
- From: Tom Birch <email@hidden>
- Date: Thu, 31 Mar 2005 11:37:58 +1000
On 31/03/2005, at 2:08 AM, todd ransom wrote:
I have a sample project that does filtering and searching exactly as
you describe at http://returnself.com/code.php. It is based on the
filtering array controller on mmalc's page at
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
Of course the "instant" part will depend on what your search routine
is doing.
hmm, this suffers from the exact same thing that I'm finding: if you
put an NSLog() call with some random string as the first statement in
the "search:" implementation, you'll find that if you press a key,
search won't get called until after a short delay. This is the part
that I find really annoying, as the responsiveness of my app has
nothing to do with how fast my filtering method is, it's all dependent
on a timer in NSSearchView that delays the sending of the designated
action.
does anyone have any ideas how to overcome this?
Tom
hope that helps,
TR
On Mar 30, 2005, at 12:19 AM, Tom Birch wrote:
I'm trying to implement searching ala iTunes, Xcode API
documentation, etc, for my NSArrayController. I've subclassed it to
override the arrangeObjects: method to filter the array, and I'm
trying to figure out how to connect the search string to the array
controller. I'm getting really frustrated with the two outcomes...
1) I use target/action and implement a method in the array controller
subclass, and whenever I type a key into the search field, about
0.5sec later the search is reflected in my NSTableView
or
2) I use bindings to bind the value of the search field to the search
string in the array controller (the setSearchString method also calls
rearrangeObjects). This causes the NSTableView to update instantly
(no delay whatsoever) but also results in the search field resigning
firstResponder status after a single key stroke, so to enter multiple
keystrokes (ie a word) i have to keep clicking in it for each
character.
How can I have instantaneous updating of the NSTableView without this
silly firstResponder issue? Ie how can I make it behave just like
iTunes/Xcode
Tom
_______________________________________________
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
_______________________________________________
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