Post

Replies

Boosts

Views

Activity

ios17 Xcode15 Core Spotlight doesn't work
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"); }];
1
0
485
Sep ’23