• 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: Trouble using ANY operator in an NSArrayController search predicate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble using ANY operator in an NSArrayController search predicate


  • Subject: Re: Trouble using ANY operator in an NSArrayController search predicate
  • From: Greg Herlihy <email@hidden>
  • Date: Fri, 19 May 2006 13:46:11 -0700
  • Thread-topic: Trouble using ANY operator in an NSArrayController search predicate

Remove the "ANY" from the search filter predicate. A filtering predicate is
applied to each item individually in order to determine whether the item
should be filtered out.

Greg


On 5/19/06 8:19 AM, "Jim Correia" <email@hidden> wrote:

> Assuming the following entities
>
> Course
> name
> students
>
> Student
> name
> courses
>
> and the automatically generated UI in IB.
>
> I've added an additional predicate to the search field
>
> ANY courses.name CONTAINS[cd] $value
>
> A predicate of this form works correctly[1] when executed directly
> against a MOC. However, when the search field applies it as the
> filterPredicate, the following exception is raised.
>
> The left hand side for an ALL or ANY operator must be either an
> NSArray or an NSSet.
>
> #0 0x90a4c4d8 in objc_exception_throw
> #1 0x92adecec in -[NSPredicateOperator
> performOperationUsingObject:andObject:]
> #2 0x92adae08 in -[NSComparisonPredicate
> evaluateWithObject:variableBindings:]
> #3 0x92adc37c in -[NSPredicate evaluateWithObject:]
>
> What am I doing wrong?
>
> How do I filter by "student is enrolled in one or more courses whose
> name contains "physics"?
>
> Thanks,
> Jim
>
> [1] Subject to the constraints of a bug which isn't relevant here.
>  _______________________________________________
> 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

  • Follow-Ups:
    • Re: Trouble using ANY operator in an NSArrayController search predicate
      • From: Jim Correia <email@hidden>
References: 
 >Trouble using ANY operator in an NSArrayController search predicate (From: Jim Correia <email@hidden>)

  • Prev by Date: RE: Shared Instance of a class
  • Next by Date: NSAppleScript not in the main thread
  • Previous by thread: Trouble using ANY operator in an NSArrayController search predicate
  • Next by thread: Re: Trouble using ANY operator in an NSArrayController search predicate
  • Index(es):
    • Date
    • Thread