Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iCloudFilesDidChange: called repeatedly #37

Closed
BobDG opened this issue Mar 20, 2014 · 3 comments
Closed

iCloudFilesDidChange: called repeatedly #37

BobDG opened this issue Mar 20, 2014 · 3 comments
Labels
Milestone

Comments

@BobDG
Copy link

BobDG commented Mar 20, 2014

The iCloudFilesDidChange method:

- (void)iCloudFilesDidChange:(NSMutableArray *)files withNewFileNames:(NSMutableArray *)fileNames

Is called nearly five times in a row after each other. I would like to display a spinner until the sync is done, but I don't know whether it will be called three times, four times, etc. So I don't know when to stop the spinner.

But ignoring the spinner (I can work around that), why is this method called so many times after one change? Wouldn't it be simpler if was just called once?

@Sam-Spencer Sam-Spencer changed the title iCloudFilesDidChange called many times iCloudFilesDidChange: called repeatedly Apr 8, 2014
@Sam-Spencer Sam-Spencer added the bug label Apr 8, 2014
@Sam-Spencer
Copy link
Member

Thanks for reporting the issue. I am working on a new release (7.3) which fixes this issue. Here's how I've resolved the issue in the 7.3 update:

  • Changed the internal enumerateCloudDocuments method to properly respond to query notifications.
  • Added two new delegate methods:
    • iCloudFileUpdateDidBegin is called when an update begins (only called once per update)
    • iCloudFileUpdateDidEnd is called when an update finished (only called oncer per update)
  • Updated query enumeration and parse code for more efficiency and reliability

I'll post here when the update is available

Sam-Spencer pushed a commit that referenced this issue Apr 9, 2014
Improvements to file updates and queries (fixes #37). Added two new delegate methods to address file update issues. New iOS 7 file querying procedure. Improved 64-bit support by changing all “id”s to “instancetype”s. Finished transition to complete auto-synthesis of properties.
@BobDG
Copy link
Author

BobDG commented Apr 9, 2014

Hi Sam,

that sounds perfect! Thanks!

@joshbirnholz
Copy link

This issue is happening to me, too. iCloudFilesDidChange is being called once for every file that changed, so I don't want to use that to update my UI. But, iCloudFileUpdateDidEnd isn't being called. It's called once, by a sync that seems to be triggerred automatically when I open the app, but after that it's never called again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants