Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8864749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:19:33+00:00 2026-06-14T16:19:33+00:00

Im adding a move to folder functionality to my app with dropbox support. Im

  • 0

Im adding a “move to folder” functionality to my app with dropbox support. Im trying to get all folders, and subfolders throughout the whole users dropbox. Heres the code i have right now that if logged, has the right order but is backwards

-(void)restClient:(DBRestClient *)client loadedMetadata:(DBMetadata *)metadata {

    if (allFolders == nil) {
        allFolders = [[NSMutableArray alloc] init];
        [allFolders addObject:@"/"];
    }

    for (DBMetadata *fileMetadata in metadata.contents) {

        if ([fileMetadata isDirectory]) {
            NSArray *filePathComponents = [fileMetadata.path pathComponents];
            NSString *inFolder = [filePathComponents objectAtIndex:[filePathComponents count]-2];
            NSLog(@"file is in folder %@",inFolder);
            [allFolders insertObject:fileMetadata.filename atIndex:[allFolders indexOfObject:inFolder]];
            if ([metadata.contents count] > 0) [[self restClient] loadMetadata:fileMetadata.path];

        }

    }

}

the issue with this is my hViewFoldersViewController also has to show all folders for the documents directory for the app, and i use a custom NSObject called Folder Item which stores all items path, name, and indent level for the table. if i use this method, i cannot get the path because al lFolders in inside the dropbox helper class, i can move it to the viewcontroller but the thing that is confusing me is getting the objectAtIndex. if i leave it to just adding objects, it will show all first level folders, then second, then third. i want it so if in dropbox you have a folder called “test 1” and then test 1 contained “test 2”, then it shows test 1, then with more indent the test 2 folder and then other first directory folders. and if i use my FolderItem in the array i cannot find the objectAtIndex. How can i get the index of the folders i need to insert then?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T16:19:34+00:00Added an answer on June 14, 2026 at 4:19 pm

    The issue you are having is that you are building a simple list of filenames. You need to build a tree structure. One way is to create an array of dictionaries. Each element in the array is a dictionary. The dictionary contains the filename and an array of its subdirectories.

    As the restClient:loadedMetadata: method is called, you need to look at the metadata to determine the parent directory. Use this to find the correct spot in your tree structure so you can fill in the subdirectory array at the proper node in the tree.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on moving my whole vim config to my Dropbox folder in order
I'd like to move items from one list view to another. adding them to
Adding functionality to a class can be done by adding a method or by
I just recently move to Xcode 4, now I'm stuck trying to find the
I have a rails 3.1 app and I am adding carrierwave to store images.
I am adding TabHost(it is like iphone) in My application,when click any TabHost Move
I'm trying to move and resize a label, but what happens is the label
I've decided to move all my projects (multiple DLLs and an executable) into a
I am trying to move the m_settings variable from the volatile to the persistent
Is there a command to move the whole SVG path to a new position,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.