vanya
vanya

Reputation: 59

Cocoa code- How to see a created folder in iPhone's Document?

As iam a newbie in iPhone app development, please help me with this issue. According to my code, iam trying to create a folder called "New Folder" in the Documents. When i run this code, iam able to get the output in NSLog with the complete path and i can see where the folder is getting created in my system as well. But the problem is iam not able to see this folder in iPhone simulator. Is there any way to see this folder which i have created in simulator?

NSArray   *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,       NSUserDomainMask, YES);
NSLog(@"%d",[paths count]);
NSString  *documentsDirectory = [paths objectAtIndex:0];
NSString  *filePath = [NSString stringWithFormat:@"%@/New Folder", documentsDirectory];
NSLog(@"Path is: %@",filePath);
NSFileManager *manager = [NSFileManager defaultManager];
NSLog(@"%d",[manager createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:nil]);
NSLog(@"Folder created");

Upvotes: 0

Views: 213

Answers (3)

Jayprakash Dubey
Jayprakash Dubey

Reputation: 36447

You can see folder created manually by using following steps :

  1. Go to Finder Window
  2. Select Application Support
  3. iPhone Simulator
  4. Now, Select simulator version (say 6.1)
  5. Applications (contains list of application that are executed)
  6. Select your Application folder
  7. Documents contains user created folders.

This is shown in screenshot

enter image description here

Upvotes: 0

Muhammad Zeeshan
Muhammad Zeeshan

Reputation: 2451

For more simplicity for viewing folders in document directory follow the steps:

1) NSLog the path and then copy it from console.

2) Open finder press Command+shift+g

3) Paste the path and press go.

Upvotes: 1

IronManGill
IronManGill

Reputation: 7226

Yes you can see this folder by going through the following steps....

Open Your Finder Window. Go to Library -> Application Support -> iPhone Simulator -> Choose the type of Simulator(like 6.1, 5.0 etc) - > Applications -> Check the project of the simulator by its Name after going into the numbers -> Document.

This is your Document Directory. You will find your files here.

enter image description here

Upvotes: 2

Related Questions