限制NSMetadataQuery的范围(Limit scope of NSMetadataQuery)
我试图限制NSMetadataQuery项的范围。 我知道有-setSearchScope:方法(参见文档 ),但它只允许我决定项目将搜索哪些目录。
如果我需要从作用域中排除一个或多个目录怎么办?
I was trying to restrict the scope of an NSMetadataQuery item. I know there's the -setSearchScope: method (see the docs), but it lets me only decide in which directories the item will search.
What if I need to exclude one or more directories from the scope?
最满意答案
不幸的是,我不相信这是可能的,因为kMDItemPath属性没有被Spotlight索引,因此在查询中不可用。
提交错误 。
Unfortunately, I don't believe this is possible, since the kMDItemPath attribute is not indexed by Spotlight, and is therefore not usable in a query.
File a bug.
更多推荐
发布评论