开发者

Obj-C equivalent for mdfind?

开发者 https://www.devze.com 2023-03-02 13:25 出处:网络
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:

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

0

精彩评论

暂无评论...
验证码 换一张
取 消