Re: filtering a list like address book
Re: filtering a list like address book
- Subject: Re: filtering a list like address book
- From: August Trometer <email@hidden>
- Date: Thu, 29 May 2008 20:48:51 -0400
I'm assuming your nav aids list will have an array controller and that
you're building for Tiger or better.
You can get the search behavior by adding a search field to your
interface and binding the search field's predicate to the array
controller's filterPredicate. It will then filter your array of nav
aids in real time, and there's no code necessary -- it's all done in IB.
You'll have to fiddle with the predicateFormat in the bindings tab.
More information is here:
http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Articles/pUsing.html
-- August
On May 29, 2008, at 8:39 PM, Nick Zitzmann wrote:
On May 29, 2008, at 6:36 PM, Mark Bateman wrote:
I'm writing an application to display a list of nav aids. I'd like
to be able to search the list like the iphone address book does.
I.e. you type and the list filters in realtime. does anyone have
any code snippets to point me in the right direction.
No, but that's not too difficult to do - have an internal NSTimer
that is reset every time the text changes, and triggers the search
in a fraction of a second.
Nick Zitzmann
<http://www.chronosnet.com/>
________________________________
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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