Re: NSPredicate: To be, or not to be
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 09:10:35 +0700
On 2 Jun 2008, at 00:20, email@hidden wrote:
On Sun, Jun 1, 2008 at 9:17 AM, Gerriet M. Denkmann
<email@hidden> wrote:
When I use an NSMetadataQuery with the NSPredicate
<kMDItemTextContent LIKE
"To be, or not to be;"> it seems to find all documents which
contain these
words in any order; and as they are kind of common, it finds 23363
files.
Not quite what I intended.
Actually I am looking for those documents which contain this
string exactly
as written (e.g. Shakespeare/Plays/Hamlet/3.1.rtf ).
I believe you want "contains", not "like".
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).
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