2

Trying to upload file to dropbox but getting error:

No visible @interface for 'DBFILESUserAuthRoutes' declares the selector 'uploadData:mode:autorename:clientModified:mute:propertyGroups:inputData:'

My code is below:

DBUserClient * clientt = [DBClientsManager authorizedClient ];
    NSData *fileData = [filename dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];

    // For overriding on upload
    DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];


    [[[clientt.filesRoutes uploadData:fullPath
                                mode:mode
                          autorename:@(YES)
                      clientModified:nil
                                mute:@(NO)
                      propertyGroups:nil
                           inputData:fileData]
      setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {
          if (result) {
              NSLog(@"%@\n", result);
          } else {
              NSLog(@"%@\n%@\n", routeError, networkError);
          }
      }] setProgressBlock:^(int64_t bytesUploaded, int64_t totalBytesUploaded, int64_t totalBytesExpectedToUploaded) {
          NSLog(@"\n%lld\n%lld\n%lld\n", bytesUploaded, totalBytesUploaded, totalBytesExpectedToUploaded);
      }];

Did googled a lot from 3 days got the same code even on dropbox official page but no luck yet. Please guide what is missing or wrong here.

2 Answers 2

3

The Dropbox Objective-SDK is occasionally updated, which will sometimes include new parameters. When you update your copy of the SDK, or if you're working from older samples that were written for older versions of the SDK, you may need to add parameters to match the interface offered by the version you're using.

For instance, a strictConflict parameter was added to the SDK's uploadData method. You'll need to update your code accordingly to add that parameter. You can just pass in nil if you want to use the default value, like this:

                           propertyGroups:nil
                           strictConflict:nil
                                inputData:fileData]

Or, you can pass in a specific value like this:

                           propertyGroups:nil
                           strictConflict:@(NO)
                                inputData:fileData]
1
  • Yes got that yesterday late evening, it's a bug in dropbox documentation as not mentioned there. Plus this is not for file upload but, it is creating a file with some text or string as parameter then upload. Very poor documentation by dropbox.
    – iPhone 7
    Commented May 2, 2019 at 6:33
1

now they also added contentHash (outdated documentation/not documented in API reference!!! I recognized this parameter by inspecting their API Explorer at https://dropbox.github.io/dropbox-api-v2-explorer/#files_upload after doing long long searches, analyses, try and error and finally doing an educated guess

[[[client.filesRoutes

  uploadData:dropboxpath 
  mode:mode 
  autorename:@(YES) 
  clientModified:nil 
  mute:@(NO) 
  propertyGroups:nil 
  strictConflict:@(NO)

  contentHash:nil 
  
  inputData:fileData]

such docu sucks.

1
  • Just found this, for which many thanks. Problem still there and documentation still not updated - pretty poor from Dropbox. Commented Oct 5, 2022 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.