When I saved the PDF file to a file using the URL, the saved pdf file does not appear in the document window of iTunes / My iPad / Apps / MyApp. In fact, I donβt even see my application in the "File Sharing" section. How to do this, for example, like "dropbox" or "pages"?
Used code
// url pdf I want
NSURL *pdfURL = [NSURL URLWithString:@"http://manuals.info.apple.com/en/iphone_user_guide.pdf"];
// Get the path to our document directory
NSArray *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
// This should be our document directory
NSString *saveDirectory = [documentPath objectAtIndex:0];
NSString *saveDirectory2 = [[saveDirectory stringByAppendingPathComponent:@"myfile.pdf"] retain];
// convert PDF to NSData, maybe I canβt convert from PDF?
NSData *dataToWrite = [NSData dataWithContentsOfURL:pdfURL];
// write pdf converted to memory along the way
BOOL status = [dataToWrite writeToFile:saveDirectory2 atomically:YES];
source
share