Find downloaded file in iPhone document folder via iTunes

I am new to iOS and just started to learn. I created an application to upload files to the Documents folder of a directory. When I upload files to the simulator, I can find it along the path: / Users /......./ Simulator / iOS7.0 / Applications / Documents. But I can’t find the files when I launch the application on the device and upload the files. I gave the way using the following code:

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

Can anyone tell me how to find files on a device using iTunes?

+4
source share
2 answers

How to simply download all files from a sandbox to your Mac? Open Xcode, Window-> Organizer.

"" "" . , Mac.

+1

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];

: bool info.plist, itunes.? Check this bool in your info.plist to share files with itunes. UIFileSharingEnabled . .

enter image description here

0

Source: https://habr.com/ru/post/1524808/


All Articles