Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Stuart T.
11 years agoNew member | Level 1
Using Sync API to open files when already open
I'm using the iOS Sync API to load in image files and grab there contents and display them in a scroll view. As the user scrolls it loads and unloads images. But I see that once you open a file you cannot open it again. So I am getting errors when it tries to load again. I don't really need to keep the files open, but I cannot find a way to close them, or grab an already open file.
What is the best practice for this? Should I just keep a dictionary of files and there paths? I was trying this but running into memory issues.
- (DBFile )openFile:(DBPath *)path error:(DBError *)error; // I'm using this function and calling it in a block via: dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
2 Replies
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
You probably will want to close any files you don't need to keep open. For reference, you can close a
DBFileusing theclosemethod, documented here:https://www.dropbox.com/developers/sync/docs/ios#DBFile.close
- Stuart T.11 years agoNew member | Level 1
Yes! How did I miss that? I was looking everywhere for close. I must've just been looking for it in DBFilesystem. Thanks for pointing out the obvious :)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!