Re: NSMetadataQuery parsing error
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