限制NSMetadataQuery的范围(Limit scope of NSMetadataQuery)

编程入门 行业动态 更新时间:2024-10-26 04:30:07
限制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.

更多推荐

本文发布于:2023-08-07 12:23:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1464199.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NSMetadataQuery   Limit   scope

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!