Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8809477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:53:08+00:00 2026-06-14T02:53:08+00:00

Apples code example suggests observing NSMetadataQueryDidUpdateNotification for detecting changes in iCloud, but this fires

  • 0

Apples code example suggests observing NSMetadataQueryDidUpdateNotification for detecting changes in iCloud, but this fires multiple times per iCloud transaction.
Their app processes the files in the “fileListReceived” message every time NSMetadataQueryDidUpdateNotification fires.

This is not an ideal solution for applications with many documents.

voromax suggests here that a better solution is to observe the attribute values of NSMetadataItem.

Can anyone please explain/show/elaborate on how this would work, or offer an alternative solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T02:53:09+00:00Added an answer on June 14, 2026 at 2:53 am

    NSMetadataQuery is good for watching the iCloud file container for files that appear or disappear (i.e. add or remove). While you’re correct in that the notification can fire often, whether it’s sub-optimal or not in your app depends on what you do with the data returned. The example reloads the entire list each time but if you need to handle a lot of documents that are potentially updated often, you could come up with a more sophisticated approach that only operates on the changes.

    For watching changes (to the contents) of documents in the container (for instance if they are open and you want to update the UI with changes), you need to combine the metadata query with observing UIDocumentStateChangedNotification for each document you care about in this context. It will tell you when the document has been updated and you can react – update the UI, etc…

    I believe the question you linked is talking about using KVO to track the properties of individually returned NSMetadataItems, specifically the download status, to determine exactly when a document has finished downloading (or uploading) from iCloud. This would be useful for displaying a progress bar, for example. This is not a good substitute for UIDocumentStateChangedNotification but it could be a good compliment. To really have a robust UIDocument/iCloud implementation, many apps combine all of these methods to give the user the best experience.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have used the code from apples example from this page: Link , but
Example: list($fruit1, $fruit2) = array('apples', 'oranges'); code above of course works ok, but code
i use some code for inline cell editing from Apples TaggedLocations Example and im
I have a line of code like this: List<string>[] apples = new List<string>()[2]; Its
I am using the apple example code SpleakHere . in this code there is
This code is works fine when you type 22 and 56 for example, it
I'm seeing a strange behavior in my code, here's an analogous example using apples
In Apple's documentation and example code, I see lproj folders both named with the
Here in Apple's sample code I found this type of persistence storage. Can anyone
This is unmodified code from Apple's iPhone 'Utility Aplication' template: - (void)applicationDidFinishLaunching:(UIApplication *)application {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.