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

  • SEARCH
  • Home
  • 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 9136253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:55:43+00:00 2026-06-17T08:55:43+00:00

I am new programmer in objective c. I want to create Download directory inside

  • 0

I am new programmer in objective c. I want to create “Download” directory inside the i phone(path : setting (i phone setting directory))I want to know is it possible?. I am using i phone simulator to test the program.

Another question is, How can I access created directory in i phone simulator. Below contains code I tried to create folder in i phone. But I can not access that directory by using i phone simulator. what the wrong of this code?

NSString *error;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"/Test"];

if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath])
    [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&error];
  • 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-17T08:55:44+00:00Added an answer on June 17, 2026 at 8:55 am

    you can create Directory in to Document Directory as sub Folder like this way:-

    -(IBAction)CreatDirInDocDir
    {
    
        NSFileManager *filemgr = [NSFileManager defaultManager];
        NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
        NSString *dir = [NSString stringWithFormat:@"%@",DirName];
        NSString *path = [documentsDirectory stringByAppendingPathComponent:dir];
    
        NSError *error;
    
        if ([filemgr fileExistsAtPath:path ] == YES){
    
        }
        else
        {
            NSLog (@"File not found");
    
            [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:NO attributes:nil error:&error];
        }
    
    
    }
    

    when ever you create directory in to Document directory folder then you can get all list of Created Custom directory like this way:-

    //Get all Directory
    
     NSFileManager *fileMan = [NSFileManager defaultManager];
    
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
    
        NSArray *filePathsArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:documentsDirectory  error:nil];
    
        NSLog(@"files array %@", filePathsArray);
    
        NSMutableArray *directoryList=[[NSMutableArray alloc]init];
    
    
        for ( NSString *direPath in filePathsArray )
        {
            NSString *path = [documentsDirectory stringByAppendingPathComponent:direPath];
            BOOL isDir = NO;
            [fileMan fileExistsAtPath:path isDirectory:(&isDir)];
            if(isDir) {
                NSString *fullPath = [documentsDirectory stringByAppendingPathComponent:path];
                NSLog(@"log path ==%@",fullPath);
                [directoryList addObject:fullPath];
            }
        }
    

    NSLog(@”list path ==%@”,directoryList);

    Now you have array of all directory you can get any directory with index 🙂
    Hope its helps you

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

Sidebar

Related Questions

I am new to Objective-C and want to know about inheritance. I am aware
Possible Duplicate: C++: When to use References vs. Pointers I'm pretty new programmer to
I'm a new Python programmer who is having a little trouble using 'self' in
I'm new to Objective-C, but experienced in C++ and C. I want to store
I'm relatively new to Objective-C (mainly using cocoa/apple foundation framework), but a long-time C++
I am a new programmer to Objective-C. I use a storyboard in my app.
i'm new programmer all i know is has 2 way to sql transaction control
I am a new Objective-C programmer coming from a C#, VB.NET, Etc. These are
I'm new with Objective C and am not an uber programmer anyway but one
i am new programmer. and i am using Google Distance Matrix API. I am

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.