Re: filter Predicate - NSArrayController
Re: filter Predicate - NSArrayController
- Subject: Re: filter Predicate - NSArrayController
- From: Chris Idou <email@hidden>
- Date: Sat, 23 Aug 2008 06:45:21 -0700 (PDT)
Yeah, but that's not going to update immediately when the field changes, is it?
The NSArrayController doco mentions:
"When you detect that filtering criteria change (such as when listening to the text sent by an NSSearchField instance), invoke this method on self."
What is the correct way to listen to changes on NSSearchField in order to re-trigger filtering?
--- On Fri, 8/22/08, Timothy Larkin <email@hidden> wrote:
> From: Timothy Larkin <email@hidden>
> Subject: Re: filter Predicate - NSArrayController
> To: email@hidden
> Date: Friday, August 22, 2008, 12:38 PM
> I usually do something like this.
>
> NSString *key = [searchField stringValue];
> NSPredicate *predicate = [NSPredicate
> predicateWithFormat:@"title ==
> %@", key];
>
> Then
>
> [arrayController setFilterPredicate:predicate];
>
> triggers the binding.
>
> The "==" operator is strict equality. You can
> make the comparison case-
> insensitive using "like[c]".
>
>
> --
> Timothy Larkin
> Abstract Tools
> Caroline, NY
_______________________________________________
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