Re: NSMetadataQuery not handling scopes and predicates as expected
Re: NSMetadataQuery not handling scopes and predicates as expected
- Subject: Re: NSMetadataQuery not handling scopes and predicates as expected
- From: Scott Anguish <email@hidden>
- Date: Sun, 3 Jul 2005 06:14:21 -0400
On Jul 3, 2005, at 2:40 AM, Ken Tozier wrote:
I managed to get some NSMetadataQuerys working but when attempting
to use any of the scope constants, the query returns immediately
with no results. Here's the various syntaxes I've tried:
NSMetadataQuery *query = [[NSMetadataQuery alloc] init];
This works
[query setSearchScopes: [NSArray arrayWithObjects: @"/System/
Library/", nil]];
which is interesting, as I don't believe anything in /System is
actually indexed. You'll be able to search on File metadata items,
but nothing else...
These don't
[query setSearchScopes: [NSArray arrayWithObjects:
NSMetadataQueryUserHomeScope, nil]];
this and
[query setSearchScopes: [NSArray arrayWithObjects:
NSMetadataQueryLocalComputerScope, nil]];
this are the correct format..
Second problem is that some of the Spotlight meta-data keys don't
seem to work. I defined several searches in the Finder and tried
using the same keys the Finder uses like "kMDItemKind" without
success.
The Finder displays this key's usage for a ".strings" file search
in the "Get Info" panel like so:
(kMDItemKind = '*Strings File*'cd)
again.. interesting.. I think this must be a problem with your
app, because if you run the Spotlighter example, and enter *String
File* you get loads of .strings files showing up
_______________________________________________
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