Is there a way to do a Spotlight query, in Obj-C, similar to what mdfind
doe开发者_StackOverflow社区s? I need to write a method with the following signature:
-(NSString *)mdfind:(NSString *)theFileToLookFor
where the returned NSString
is the first path found by the search.
Any help will be really appreciated.
NSMetadataQuery
is the wrapper around the Carbon-level MDQuery
API, which is how one interacts with the user's spotlight database.
the apis are in CoreServices.framework. start with the ones which have the prefix MDQuery
精彩评论