- objective-c - iOS 5 : Can you override UIAppearance customisations in specific classes?
- iphone - 如何将 CGFontRef 转换为 UIFont?
- ios - 以编程方式关闭标记的信息窗口 google maps iOS
- ios - Xcode 5 - 尝试验证存档时出现 "No application records were found"
我正在尝试将我自己的事件添加到 osx 10.11 上的 Spotlight 搜索结果中。但经过多次尝试,我无法通过关键字搜索或标题搜索进入 Spotlight 搜索结果。
{
self.userActivity = [[NSUserActivity alloc] initWithActivityType:@"Reverse DNS keyword"];
self.userActivity.title = @"Some title";
self.userActivity.keywords = [NSSet setWithArray: @[@"Some keywords"]];
self.userActivity.eligibleForSearch = YES;
self.userActivity.eligibleForHandoff = YES;
self.userActivity.eligibleForPublicIndexing = YES;
self.userActivity.userInfo = @{@"name" : @"Some name"};
self.userActivity.delegate = self;
self.userActivity.requiredUserInfoKeys =[NSSet setWithArray: @[@"name"]];
self.userActivity.needsSave = YES;
[self.userActivity becomeCurrent];
NSApp.userActivity = self.userActivity;
}
- (void)userActivityWillSave:(NSUserActivity *)userActivity
{
userActivity.userInfo = @{@"name" : @"Some name"};
}
我还用 NSUserActivityTypes 数组和 initWithActivityType: 参数中的项目更新了 Info.plist
我还注意到在控制台中有时会出现消息:
16/09/2016 13:14:49.731 Caching encoded userInfo to use until we are marked dirty again (UAUserActivity.m #1567)
16/09/2016 13:14:49.731 Returning cached encoded userInfo (UAUserActivity.m #1508)
最佳答案
经过大量搜索,最终我在 TN2416 中找到了我的问题的答案。 :
**Are these new Search APIs available on OS X?**
CoreSpotlight and the search functionality of NSUserActivity are not supported on OS X. However, web search results may be shown on OS X.
关于ios - NSUserActivity 没有在 osx 上建立索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39529454/
我正在使用 Gunicorn 为 Django 应用程序提供服务,它工作正常,直到我将其超时时间从 30 秒更改为 900000 秒,我不得不这样做,因为我有一个用例需要上传和处理一个巨大的文件(过程
我有一个带有非常基本的管道的Jenkinsfile,它可以旋转docker容器: pipeline { agent { dockerfile { args '-u root' } } stag
在学习 MEAN 堆栈的过程中,我遇到了一个问题。每当我尝试使用 Passport 验证方法时,它都不会返回任何响应。我总是收到“localhost没有发送任何数据。ERR_EMPTY_RESPONS
在当今的大多数企业堆栈中,数据库是我们存储所有秘密的地方。它是安全屋,是待命室,也是用于存储可能非常私密或极具价值的物品的集散地。对于依赖它的数据库管理员、程序员和DevOps团队来说,保护它免受所
是否可以创建像图片上那样的边框?只需使用 css 边框属性。最终结果将是没 Angular 盒子。我不想添加额外的 html 元素。我只想为每个 li 元素添加 css 边框信息。 假设这是一个 ul
我是一名优秀的程序员,十分优秀!