• 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: NSPredicate: To be, or not to be
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPredicate: To be, or not to be


  • Subject: Re: NSPredicate: To be, or not to be
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Mon, 2 Jun 2008 23:08:10 +0700


On 2 Jun 2008, at 16:52, email@hidden wrote:

On Sun, Jun 1, 2008 at 9:10 PM, Gerriet M. Denkmann <email@hidden> wrote:
Following your suggestion, I changed my predicateFormat to:
@"%@ contains kMDItemTextContent" which translates into:
<kMDItemTextContent IN "To be, or not to be"> and behaves more or less
exactly like LIKE.


So again: how to search kMDItemTextContent for a string containing spaces?
(10.4.11).

This came up in the last question you asked. You're not constructing your formats properly.

[NSPredicate predicateWithFormat:@"%K contains %@",
kMDItemTextContent, @"To be, or not to be"]

Constucting the format properly (copying your suggestion):
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K contains %@", kMDItemTextContent, @"To be, or not to be"];


results in:
[...] Exception raised during posting of notification. Ignored. exception: NSComparisonPredicate with left expression which is not NSKeyPathExpressionType given to NSMetadataQuery ("To be, or not to be" IN kMDItemTextContent)


So: what am I doing wrong?

Kind regards

Gerriet.

_______________________________________________

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


  • Follow-Ups:
    • Re: NSPredicate: To be, or not to be
      • From: "stephen joseph butler" <email@hidden>
  • Prev by Date: many-to-many relationships and retain cycles
  • Next by Date: Re: many-to-many relationships and retain cycles
  • Previous by thread: Re: NSPredicate: To be, or not to be
  • Next by thread: Re: NSPredicate: To be, or not to be
  • Index(es):
    • Date
    • Thread