Forum Discussion

Brendan D.'s avatar
Brendan D.
Explorer | Level 4
11 years ago

Sync API openFile delay OS X

Using the following code, I'm not getting the DBFile object after my code executes initially. There seems to be a delay. I know the file is there in my Dropbox folder.

DBPath *dbPhotoPath = [dbPhotosFolderPath childPath:photoFileName];
DBFile *dbPhotoFile = [fileSystem openFile:dbPhotoPath error:&dbError];

So initially when I run this code the dbPhotoFile ends up being nil. I seem to have to was a little while before calling the code again to get an actual dbPhotoFile object.

I'm calling this code from my NSTableView heightOfRow method to get the height of the row initially and then again to get the image to display in my cell.

The dbPhotoPath object is valid, but the dbPhotoFile is initially nil. I print out the dbError object and there is no error. It is nil.

Is there always going to be a delay in calling the openFile method? Or am I doing something wrong?

Thanks,

Brendan

2 Replies

Replies have been turned off for this discussion
  • Brendan D.'s avatar
    Brendan D.
    Explorer | Level 4
    11 years ago

    One of my sentences up there should read "I seem to have to wait a little while".

    Does the openFile command perhaps operate asynchronously? Or does the sync API need to be "warmed up" or something before the openFile call will return anything?

  • Brendan D.'s avatar
    Brendan D.
    Explorer | Level 4
    11 years ago

    Ok, never mind. It turns out it was my DBFileSystem which was being initialized after a delay.

    All is well. Sorry to bother you.

About Dropbox API Support & Feedback

Node avatar for 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!