• 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: Search multiple / all properties in single NSPredicate statement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Search multiple / all properties in single NSPredicate statement


  • Subject: Re: Search multiple / all properties in single NSPredicate statement
  • From: Kirk Kerekes <email@hidden>
  • Date: Wed, 13 Jan 2010 11:37:30 -0600

Create a property for the target class that concatenates the text value of all the other properties of interest, and then search on that?

On Jan 13, 2010, at 9:46 AM, email@hidden wrote:

> Message: 5
> Date: Tue, 12 Jan 2010 17:10:10 -0800
> From: Mike Chambers <email@hidden>
> Subject: Search multiple / all properties in single NSPredicate
> 	statement
> To: email@hidden
> Message-ID:
> 	<email@hidden>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I am using NSPredicate to filter Mutable Arrays of objects. This works
> great. However, I have a need to filter on multi object properties in
> the Array. Basically, a full text search of the object properties.
>
> I know I can do this by creating a compound predicate for each field,
> but I wanted to check and see if there was an easier way to accomplish
> this.
>
> I tried to use a wildcard for the keypath:
>
> [NSPredicate predicateWithFormat@"* == 'foo'];
>
> But, that doesnt work. Looking at the docs, I dont see a way to do
> this, but wanted to ping the list.
>
> So, is there anyway to search multiple / all object fields in a single
> predicate statement?

_______________________________________________

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: Scaled NSImage size of NSImageView?
  • Next by Date: Displaying a non-contentual menu & attachPopUpWithFrame
  • Previous by thread: Search multiple / all properties in single NSPredicate statement
  • Next by thread: Managed Object with Getter
  • Index(es):
    • Date
    • Thread