• 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: filter Predicate - NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Prev by Date: Re: Implementing isEqual: and hash
  • Next by Date: Re: Implementing isEqual: and hash
  • Previous by thread: filter Predicate - NSArrayController
  • Next by thread: Re: ObjC 2.0, properties, KVC, special _ hacks etc.
  • Index(es):
    • Date
    • Thread