You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

billymeltdown's avatar
billymeltdown
Explorer | Level 4
9 years ago

Getting rev from DBFILESMetadata in obj-c API 2

Dear Dropbox,   Thanks for the new obj-c API v2, looks like quite an effort! So far it's more convenient to use than API v1 and integration is going well. However, I'm a little held up on how to wo...
  • Keith B.7's avatar
    9 years ago

    In your example, you would get it like this:

     

    self.dropboxFileRevision = ([result isKindOfClass:[DBFILESFileMetadata class]] ? [(DBFILESFileMetadata *)result rev] : nil);

     

    DBFILESFileMetadata is a subclass of DBFILESMetadata. Basically (as I understand it), you’ll never receive a vanilla DBFILESMetadata object in a response, but will receive one of its subclasses - DBFILESFolderMetadata, DBFILESFileMetadata or DBFILESDeletedMetadata. So you need to check the class of the meta-data object to see what you can extract from it. (I wrote a category so that I can call -isDirectory, -isFile or -isDeleted on the meta-data object rather than have to write out -isKindOfClass: each time.)

     

    (I’ve been getting to grips with the new API msyelf over the past few days, and the above comes from hounding Greg at Dropbox with questions. :) )

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,879 PostsLatest Activity: 4 hours ago
326 Following

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 or Facebook.

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!