• 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: Tue, 3 Jun 2008 07:37:17 +0700


On 3 Jun 2008, at 03:30, stephen joseph butler wrote:

On Mon, Jun 2, 2008 at 11:08 AM, Gerriet M. Denkmann
<email@hidden> wrote:
Constucting the format properly (copying your suggestion):
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K contains %@",
kMDItemTextContent, @"To be, or not to be"];

I'm sorry. I forget that the Spotlight predicate strings are slightly different from the regular ones. This works for me:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K LIKE
%@", kMDItemTextContent, @"To be, or not to be"];

This one also works for me. Only it kind of works too well, finding thousands of files.


Another example: <kMDItemTextContent LIKE "Briggel Braggel"> finds ".../Test.txt" which only contains the line: "Briggel and Braggel" .
But I really want only files which contain "Briggel Braggel" or "the Briggel Braggel of today".


Again: How to create a predicate for an 10.4.11 NSMetadataQuery to find a string which includes blanks.
Possible answers:
Escape the blanks with ..., or
Enclose whole string with ..., or something else ?


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: "Hamish Allan" <email@hidden>
    • Re: NSPredicate: To be, or not to be
      • From: "stephen joseph butler" <email@hidden>
References: 
 >Re: NSPredicate: To be, or not to be (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: NSPredicate: To be, or not to be (From: "stephen joseph butler" <email@hidden>)

  • Prev by Date: Re: Main window disappears. Sometimes.
  • Next by Date: Re: Main window disappears. Sometimes.
  • 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