cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
From Dropbox Dash and Dropbox AI to seamless integrations with tools like Gmail, learn how Dropbox makes your day more efficient and easier, and how sci-fi is becoming reality here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Reply and help

uploadURL unrecognized selector

uploadURL unrecognized selector

Bob S.15
Collaborator | Level 9

I'm trying to upload my app's old Dropbox support to the newest SDK.  Has uploadURL been killed?  All I see is "upload" -- but there's no argument for the source file, so how do you use it?  Some examples for how to use this stuff would be nice.    DBRoulette is kind of useless for most purposes.

EDIT: Ok I managed to find an example buried in this byzantine documentation.  But it is out of date.  There are new arguments in the declaration here different from the example.  

http://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html#/c:obj...:

And neither one is working for me.  Here is what I am doing -- it says "Instance method '-uploadData:mode:autorename:clientModfified:mute:propertyGroups:inputData:' not found"

Is there some way to see the actual function headers or declarations on my machine, since the documentation is so contradictory?  I choose "Go To Definition/Declaration" from XCode or or search files for "uploadData" and nothing comes up.

[[[[DBClientsManager authorizedClient].filesRoutes uploadData:finalPath
         mode: [[[DBFILESWriteMode alloc] initWithOverwrite] autorelease]
         autorename: @(NO)
         clientModfified:nil
         mute: @(NO)
         propertyGroups:nil
         inputData: fileData]
      setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *error) {
2 Replies 2

Re: uploadURL unrecognized selector

Bob S.15
Collaborator | Level 9

Okay I finally got this by grepping the SDK folder for "uploadData" and finding the true arguments to this function.   I had "Modified" spelled wrong, and there was an additional argument 'strictConflict' that was missing.  The working call looks like this.

[[[[DBClientsManager authorizedClient].filesRoutes uploadData:finalPath
         mode: [[[DBFILESWriteMode alloc] initWithOverwrite] autorelease]
         autorename: @(NO)
         clientModified:nil
         mute: @(NO)
         propertyGroups:nil
         strictConflict:nil
         inputData: fileData]

 

Seriously though am I just old or is this documentation crazy hard to navigate?  Plus it is not up to date with conflicting information all over the place...

Re: uploadURL unrecognized selector

Greg-DB
Dropbox Staff

I'm sorry to hear about the difficulty here. The method definitions can change across SDK versions as options are added. You can always find the latest definitions for the file routes in the DBFILESUserAuthRoutes documentation here:

https://dropbox.github.io/dropbox-sdk-obj-c/api-docs/latest/Classes/DBFILESUserAuthRoutes.html

I recommend using Xcode's autocomplete though, as it can produce the boilerplate for whatever method you're using, for the version of the SDK you have installed.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Bob S.15 Collaborator | Level 9
What do Dropbox user levels mean?
Need more support?