cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you new to Dropbox? Our Newcomers group is the perfect place to learn the basics, find out more 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: 

IOS build error: No visible @interface for 'DBFILESUserAuthRoutes' declares the selector 'uploadData

IOS build error: No visible @interface for 'DBFILESUserAuthRoutes' declares the selector 'uploadData

Zoey03
Helpful | Level 6
Go to solution

 

DBUserClient * client = [DBClientsManager authorizedClient ];

DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];

   

[[client.filesRoutes uploadData:objPath                                  

                                       mode:mode

                          autorename:@(YES)

                      clientModified:nil

                                mute:@(NO)

                           inputData:fileData]

      setResponseBlock:^(DBFILESFileMetadata *result, DBFILESUploadError *routeError, DBRequestError *networkError) {

          if (result) {

              NSLog(@"%@\n", result);

          } else {

              NSLog(@"%@\n%@\n", routeError, networkError);

          }

      }];

 

 

 

that's the code encountered the error.

I tried many times but still not found the way to correct it. 

 

2 Accepted Solutions

Accepted Solutions

Zoey03
Helpful | Level 6
Go to solution

Still I don't know why it encountered this error,,,

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

 

 

DBUserClient * client = [DBClientsManager authorizedClient ];
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
    [[[client.filesRoutes uploadData:@"/test/path/in/Dropbox/account/my_output.txt"
                                 mode:mode
                           autorename:@(YES)
                       clientModified:nil
                                 mute:@(NO)
                            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);
       } ] ;

   I compared the demo with these codes and they are the same.  Really need help!

View solution in original post

Greg-DB
Dropbox Staff
Go to solution

@Zoey03 To clarify, did you solve this, or do you still need help? You marked your last reply as a solution.

 

Anyway, I recommend just letting Xcode autocomplete the method call, as that will give you the definition for the version of the SDK you have installed.

 

It sounds like you're referring to this sample, which is now out of date. (I'll ask the team to update that.) It's just missing the new propertyGroups parameter, to which you can pass nil if you're not using that feature. So, an updated version would look like:

 

NSData *fileData = [@"file data example" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];

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

[[[client.filesRoutes uploadData:@"/test/path/in/Dropbox/account/my_output.txt"
                            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);
  }];

 

 

View solution in original post

7 Replies 7

Greg-DB
Dropbox Staff
Go to solution

It sounds like you're using code written for an older version of the SDK with a newer version of the SDK, where the method definition has since been changed. You can find the documentation for the current method definition here.

 

You can also have Xcode fill this in automatically using the Xcode autocomplete feature. E.g., type "

client.filesRoutes uploadData" and select the autocomplete option for the desired method.

Zoey03
Helpful | Level 6
Go to solution

Still I don't know why it encountered this error,,,

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

 

 

DBUserClient * client = [DBClientsManager authorizedClient ];
DBFILESWriteMode *mode = [[DBFILESWriteMode alloc] initWithOverwrite];
    [[[client.filesRoutes uploadData:@"/test/path/in/Dropbox/account/my_output.txt"
                                 mode:mode
                           autorename:@(YES)
                       clientModified:nil
                                 mute:@(NO)
                            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);
       } ] ;

   I compared the demo with these codes and they are the same.  Really need help!

Greg-DB
Dropbox Staff
Go to solution

@Zoey03 To clarify, did you solve this, or do you still need help? You marked your last reply as a solution.

 

Anyway, I recommend just letting Xcode autocomplete the method call, as that will give you the definition for the version of the SDK you have installed.

 

It sounds like you're referring to this sample, which is now out of date. (I'll ask the team to update that.) It's just missing the new propertyGroups parameter, to which you can pass nil if you're not using that feature. So, an updated version would look like:

 

NSData *fileData = [@"file data example" dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO];

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

[[[client.filesRoutes uploadData:@"/test/path/in/Dropbox/account/my_output.txt"
                            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);
  }];

 

 

Zoey03
Helpful | Level 6
Go to solution

Thanks a million!!  It finally passed when I add that line of code.

yesterday I marked your reply as a solution by mistaken but I didn't know how to undo, while today it is truly solved! 

 

MarkStasak
Explorer | Level 4
Go to solution

Just updated a project to SDK 3.9.4 and got similar error messages from a slightly different cause.  You may need to add strictConflict:@(NO) to certain methods like uploadData, in the same manner as propertyGroups:nil.  

iOSDev
New member | Level 2
Go to solution

same code doesn't worked for me. same error i am getting

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

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    iOSDev New member | Level 2
  • User avatar
    MarkStasak Explorer | Level 4
  • User avatar
    Zoey03 Helpful | Level 6
What do Dropbox user levels mean?