Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Download Files Using DropBoxSDK in iOS

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 305
    Comment on it

    If You want to get the list of all the files that are uploaded on your DropBox then use the following code :

    method -(void)downloadAllData:(void (^)(NSMutableArray *, NSMutableArray *, BOOL))

    block need to be called after the successful login to DropBox, it will give you the two array one for folder and one for files.

    -(void)downloadAllData:(void (^)(NSMutableArray *, NSMutableArray *, BOOL))block
    {
        dowloadDataBlock = block;
    
        folderTypeArray=[[NSMutableArray alloc]init];
    
        fileTypeArray=[[NSMutableArray alloc]init];;
    
        restClient = [[DBRestClient alloc] initWithSession:dbSession];
        metaData=@"/";
        restClient.delegate=self;
    
        [restClient loadMetadata:metaData];
    }
    
    
    
    - (void)restClient:(DBRestClient*)client loadedMetadata:(DBMetadata *)metadata
    {
    
    
        for (int i = 0; i < [metadata.contents count]; i++) {
            DBMetadata *data = [metadata.contents objectAtIndex:i];
            if (data.isDirectory)
    
                [folderTypeArray addObject:data];
    
                //Add folder object in your array
          else 
                [fileTypeArray addObject:data];
    
        }
    
        dowloadDataBlock(fileTypeArray,folderTypeArray,YES);
    
    }
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: