用于搜索的iOS 9 NSUserActivity不会更新它的缩略图

时间:2022-09-10 19:18:12

I use NSUSerActivity and CoreSpotlight for indexing. I set the thumbnailURL in the contentAttributesSet property as usual. Images are downloaded from a server and the activity object is created before the image get's downloaded. So I set a "placeholder" image and when I have the chance I update contentAttributesSet.thumbnailURL to the correct one. But when I try to search for the same item in Spotlight the image stays the same.

我使用NSUSerActivity和CoreSpotlight进行索引。我照常将thumbnailURL设置在contentAttributesSet属性中。从服务器下载图像,并在下载图像之前创建活动对象。所以我设置了一个“占位符”图像,当我有机会将contentAttributesSet.thumbnailURL更新为正确的图像。但是当我尝试在Spotlight中搜索相同的项目时,图像保持不变。

Is there any special condition that I have to be aware of when updating such info?

更新此类信息时是否有任何特殊情况需要注意?

2 个解决方案

#1


0  

Thumbnail URL is only for local urls. not remote ones. You have to use thumbnailData.

缩略图网址仅适用于本地网址。不是远程的。你必须使用thumbnailData。

#2


0  

I think that was a bug in iOS 9.0 - 9.2. It seems to be working well on iOS 9.3+

我认为这是iOS 9.0 - 9.2中的一个错误。它似乎在iOS 9.3+上运行良好

#1


0  

Thumbnail URL is only for local urls. not remote ones. You have to use thumbnailData.

缩略图网址仅适用于本地网址。不是远程的。你必须使用thumbnailData。

#2


0  

I think that was a bug in iOS 9.0 - 9.2. It seems to be working well on iOS 9.3+

我认为这是iOS 9.0 - 9.2中的一个错误。它似乎在iOS 9.3+上运行良好