Predicate oddness revisited
Predicate oddness revisited
- Subject: Predicate oddness revisited
- From: Timothy Larkin <email@hidden>
- Date: Sat, 12 Nov 2005 08:57:37 -0500
If I create a predicate binding to an NSSearchField like "name
contains 'foo'", the predicate is transformed behind the scenes to
"'foo' IN name". This works for the simple case of searching an
attribute.
Now suppose the entity has a to-many relationship named "bars" to
another entity with the attribute title. Then the predicate "any
bars.title contains 'foo'" becomes "any 'foo' in bars.title". This
generates an exception, 'The left hand side for an ALL or ANY
operator must be either an NSArray or an NSSet.' If the original
predicate is "bars.title contains 'foo'" (avoiding the ANY problem),
which transforms to "'foo' in bars.title", no exception is raised,
but the search using this predicate does not return any records.
Is it possible, then, to construct a "contains" predicate across a
relationship?
--
Timothy Larkin
Abstract Tools
Caroline, NY
_______________________________________________
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