iosnotificationsicloudicloud-api

Does the first NSMetadataQueryDidFinishGatheringNotification notification guarantee that metadata has been retrieved from iCloud?


According to apple docs, NSMetadataQueryDidFinishGatheringNotification is posted when the receiver has finished with the initial result-gathering phase of the query.

Aside from cases with no internet connection, does the first NSMetadataQueryDidFinishGatheringNotification notification guarantee that metadata has been retrieved from iCloud?

For example, if I have "sample.txt" in iCloud, if I received the first NSMetadataQueryDidFinishGatheringNotification notification, "sample.txt" will be included in the results.

On the other hand, if "sample.txt" does not exist in iCloud, its nonexistence is guaranteed on the first NSMetadataQueryDidFinishGatheringNotification notification if it is not included in the results.


Solution

  • According to Apple people, the answer is NO, the notification does not guarantee that values have been retrieved from iCloud successfully.

    NSMetadataQuery can return empty results immediately after an account change or the first login.