Reputation: 59
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
Reputation: 36447
You can see folder created manually by using following steps :
This is shown in screenshot
Upvotes: 0
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
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.
Upvotes: 2