• 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
Predicate oddness revisited
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Problem with dataWithPDFInsideRect
  • Next by Date: Re: Problem with dataWithPDFInsideRect
  • Previous by thread: Re: NSTableView and dragging cursor
  • Next by thread: Browser-like Tab View control
  • Index(es):
    • Date
    • Thread