Posts

Post not yet marked as solved
0 Replies
337 Views
I tried the answer but it still doesn't work. Can anyone help me to deal with it? Here is the code. CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc]initWithItemContentType:(NSString *)kUTTypeItem]; attributeSet.title = @"TestName"; attributeSet.displayName = @"TestName"; attributeSet.contentDescription = @"TestName"; attributeSet.keywords = @[@"TestName"]; CSSearchableItem *item = [[CSSearchableItem alloc]initWithUniqueIdentifier:@"id" domainIdentifier:nil attributeSet:attributeSet]; [[CSSearchableIndex defaultSearchableIndex] indexSearchableItems:@[item] completionHandler: ^(NSError * __nullable error) { NSLog(error? @"add searchItem fail": @"add searchItem success"); }];
Posted Last updated
.