• 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: NSMetadataQuery parsing error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMetadataQuery parsing error


  • Subject: Re: NSMetadataQuery parsing error
  • From: mmalcolm crawford <email@hidden>
  • Date: Sat, 2 Jul 2005 02:18:21 -0700


On Jul 2, 2005, at 1:21 AM, Ken Tozier wrote:

I'm trying to get my first NSMetadataQuery working and am getting the error "Unable to parse the format string "(kMDItemDisplayName = '*.jpg'cd) && (kMDItemContent != com.apple.mail.emix) && (lMDItemContent != public.vcard)" for a query copied directly from the Finder, as suggested in the Predicates programming guide.


<http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/ Articles/pUsing.html>


"Note however, that there are slight differences between the NSPredicate format string and the one stored in Finder. The Finder string might look like the following example."

(((* = "FooBar*"wcd)) || (kMDItemTextContent = "FooBar*"cd))

[...]

(((kMDItemTextContent LIKE[cd] "FooBar")


(There are a number of typos in that section which are now fixed, so please don't submit feedback.)



[query setPredicate: [NSPredicate predicateWithFormat: @"(kMDItemDisplayName = '*.jpg'cd) && (kMDItemContent != com.apple.mail.emix) && (lMDItemContent != public.vcard)"]];
->
[NSPredicate predicateWithFormat: @"(kMDItemDisplayName like[cd] '*.jpg') && (kMDItemContent != com.apple.mail.emix) && (lMDItemContent != public.vcard)"]



mmalc

_______________________________________________
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: NSMetadataQuery parsing error
      • From: Ken Tozier <email@hidden>
References: 
 >NSMetadataQuery parsing error (From: Ken Tozier <email@hidden>)

  • Prev by Date: NSMetadataQuery parsing error
  • Next by Date: Re: DotMacKit 2.0?
  • Previous by thread: NSMetadataQuery parsing error
  • Next by thread: Re: NSMetadataQuery parsing error
  • Index(es):
    • Date
    • Thread