NSUserActivity not getting indexed on osx : <p>I'm trying to add my own activity to Spotlight search results on osx 10.11. But after a lot of tries I couldn't got to be in Spotlight search results not by keywords search, not by title search.</p>

<pre><code>{
    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"};
}
</code></pre>

<p>Also I've updated Info.plist with NSUserActivityTypes array and item from the initWithActivityType: argument</p>

<p>Also I've noticed that in Console sometime appears messages:</p>

<pre><code>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)
</code></pre>
