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

Trouble using ANY operator in an NSArrayController search predicate


  • Subject: Trouble using ANY operator in an NSArrayController search predicate
  • From: Jim Correia <email@hidden>
  • Date: Fri, 19 May 2006 11:19:55 -0400

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


  • Follow-Ups:
    • Re: Trouble using ANY operator in an NSArrayController search predicate
      • From: Greg Herlihy <email@hidden>
  • Prev by Date: Re: Right way to check system version?
  • Next by Date: NSTokenField - edit existing tokens?
  • Previous by thread: Re: NSPopUpButtons in tableViews
  • Next by thread: Re: Trouble using ANY operator in an NSArrayController search predicate
  • Index(es):
    • Date
    • Thread