I am currently developing an application which is using the Dropbox iOS SDK version 1.1. I am developing the application for iOS version 5.0 and above. I went through all the methods in the DBRestClient.h file which is included in the SDK. I could not find a method which allowed me to check whether a given file exists in a given location in a directory. I was thinking if I could use the following method in the DBRestClient.h file to do the same
- (void)loadMetadata:(NSString*)path;
Here, I thought of using the Location/FileName in the Path parameter to find out whether the given file existed or not.
I am not at all sure about the correct approach for doing the same. Please suggest some better methods if this is not correct.
The Dropbox SDK does not support search (it only supports a subset of the Dropbox API). To do what you need effenciently, call the search method of the REST API directly
https://www.dropbox.com/developers/reference/api#search
If you want to stick with the SDK, you can call loadMetadata recursively for each folder level until you find the file you are looking for. But I do not recommend this (imagine if your user is on the cell network as you make tens or hundreds of calls).