如何在appDelegate中获取CSSearchableItemAttributeSet

时间:2016-03-29 06:34:00

标签: ios corespotlight

def get_conversation
    @conversation = @mailbox.conversions.new || @mailbox.conversations.find(params[:id])
 end

我已为NSMutableArray *searchableItems = [NSMutableArray array]; for (int i = 1; i < 100; i++) { CSSearchableItemAttributeSet *attributeSet = [[CSSearchableItemAttributeSet alloc]initWithItemContentType:@"vvv"]; attributeSet.title = [NSString stringWithFormat:@"warwick%d",i]; attributeSet.contentDescription = @"warwickDescriotion"; UIImage *image = [UIImage imageNamed:@"1"]; attributeSet.thumbnailData = UIImagePNGRepresentation(image); CSCustomAttributeKey *lat = [[CSCustomAttributeKey alloc]initWithKeyName:@"lat"]; [attributeSet setValue:@"123456789" forCustomKey:lat]; CSSearchableItem *item = [[CSSearchableItem alloc]initWithUniqueIdentifier:[NSString stringWithFormat:@"warwick%d",i] domainIdentifier:nil attributeSet:attributeSet]; [searchableItems addObject:item]; } [[CSSearchableIndex defaultSearchableIndex]indexSearchableItems:searchableItems completionHandler:nil]; 设置了一些searchableItems,如何在AppDelegate中获取customKey

customKeyValue

1 个答案:

答案 0 :(得分:1)

您在AppDelegate continueUserActivity方法中唯一获得的是CSSearchableItem userInfo词典中userActivity的唯一标识符,而不是其他内容。