Code:
// Create an instance of PDFViewController
PDF *pdfView = [[PDF alloc] initWithNibName:@"PDF" bundle:nil];
// Get the path to our documents directory
NSArray *documentPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
// This should be our documents directory
NSString *saveDirectory = [documentPath objectAtIndex:0];
// Our PDF is named 'Example.pdf'
NSString *saveFileName = @"example.pdf";
// Create the full path using our saveDirectory and saveFileName
NSString *finalPath = [saveDirectory stringByAppendingPathComponent:saveFileName];
// Set the pdfUrl to our finalPath
pdfView.pdfUrl = [NSURL fileURLWithPath:finalPath];
// Push 'controller'
[self.navigationController pushViewController:pdfView animated:YES];
// Release 'controller'
[pdfView release];
I am trying to understand this part of the code.
As far as i know i do not see where can i set the values of the "documentPath" and "saveDirectory".
example a "finalpath" should be " c:/Users/a/Desktop/example.pdf"
from my little knowledge i should be able to set to the variable "saveDirectory". But i just do not know how.
Anyone can shed some light?
*yes even with the comments i am so weak