cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know more about how you can find anything and protect everything? Check it out 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: 

Creating a folder that already exists (iOS)

Creating a folder that already exists (iOS)

Robert S.138
Helpful | Level 7
Go to solution

I went through this already for Android, and I learned that to create a folder that might already exists I only need to check the exception as follows:

catch (CreateFolderErrorException err) {
if( ! (err.errorValue.isPath() && err.errorValue.getPathValue().isConflict()) )
{ /* a real error, to be handled */ }
else  {/*this exception can safely be ignored*/}

Now I need to do the same thing in the Objective-C SDK for iOS.  In the completion block for createFolder I get:

^(DBFILESFolderMetadata *result, DBFILESCreateFolderError *cfError, DBError *error)

What is the equivalent check using "result", "cfError", and "error"?

 

10 Replies 10

Robert S.138
Helpful | Level 7
Go to solution

That fixed it.  Now just one import replaces all the other Dropbox imports I was using.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Robert S.138 Helpful | Level 7
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?