NSUserActivity removed after restarting device

Has anyone else seen this?


I had a bunch of results in spotlight, indexed via NSUserActivity.


I restarted the device. Now I have no results. At first I thought maybe it was just start-up delay. But after 15 minutes. Nothing. If I go back into the app and generate new results, they appear, but no sign of the previous results.


I'm not sure if this is expected behaviour or a bug, but it seems pretty strange that restarting the phone loses everything.

Replies

It only seems to apply to NSUserActivity (not coreSpotlight)

I tried this out but couldn't reproduce exactly the way you describe. But while testing it, I ran into a few problems sort of the opposite of what you experienced where items that should be removed or changed either return after a restart or don't update until after a restart.


So for example, I index several CSSearchableitem objects and they show up in search. I remove the app, search again and as I would expect all the items are now gone. Restart device, search again and the search items have returned even though my app is no longer installed. Uh oh. If I then reinstall the app and index again (but with different thumbnail image data), the item thumbnail is not updated to the new version. But then I restart the device again and now searches show the properly updated thumbnail image.


Also, if I have a CSSearhableItem and an associated (using relatedUniqueIdentifier) NSUserActivity and delete the CSSearchableItem from the index using deleteSearchableItemsWithIdentifiers it seems to properly delete the CSSearchableItem but the NSUserActivity remains and can be found using search even though as I understand it, it should go away since it has a relatedIdentifier set and the associated CSSearchableItem is now gone. If I uninstall the app and restart the device, anything removed with deleteSearchableItemsWithIdentifiers seem to stay removed, although now I can't get rid of the NSUserActivity items unless i reinstall the app and recreate the same NSUserActivity items and add a relatedUniqueIdentifier then those search items go away and stay away even after a restart and/or uninstall.

Seeing the same. Have you filed a bug?