Find Downloaded File in iPhone Documents folder through iTunes

I am new to iOS and just started learning. I have created an App for downloading files into Documents folder of the directory. When I download the files on simulator, I can find it through the path : /Users/......./Simulator/iOS7.0/Applications/Documents. But I am not able to find the files when I run the App on the device and download the files. I have given the path using the following code:

filePath = [NSHomeDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"Documents/%@", self.downloadedFilename]];    

Can anyone please tell me the way to find the files on the device using iTunes?

Answers


How about just downloading all the files from the sandbox to your Mac? Open Xcode, Window->Organizer.

Click on the Applications entry for the connected device, and click on your Application in the list of apps. Now you can see the data files on the device for that app, and you can download the whole bundle from the device to your Mac.


Use below sample code for create and write data with in created folder document

NSData *data = [[NSData alloc] initWithBytes:saves length:4]; //replace with your file content
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"/MyFolder"];

if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath])
    [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:&error];
NSString *appFile = [dataPath stringByAppendingPathComponent:@"MyFile"];
[data writeToFile:appFile atomically:YES];

Update: Did you check this bool in your info.plist before connect it with itunes.? Check this bool in your info.plist to share files with itunes. Refer UIFileSharingEnabled and see this picture below.


Need Your Help

PHP Hbase Thrift client returns array instead of TRowResult

php hbase thrift

We are using the Thrift client to access Hbase from PHP. Hbase version is hbase-0.90.4-cdh3u3.

How do I add multiple subtotals in tableau?

tableau

My report has the following structure