I found a tutorial on the net but cant figure it out.
In my view based application I have:
PDFViewController.h
PDFViewController.m
where shall I have this code? in the app delegate?

In my view based application I have:
PDFViewController.h
Code:
@interface PDFViewController : UIViewController {
UIWebView *webView;
NSURL *pdfUrl;
}
@property (nonatomic, retain) IBOutlet UIWebView *webView;
@property (nonatomic, retain) NSURL *pdfUrl;
@end
PDFViewController.m
Code:
#import "PDFViewController.h"
@implementation PDFViewController
@synthesize webView, pdfUrl;
#pragma mark -
#pragma mark UIViewController methods
- (void)viewDidLoad {
[super viewDidLoad];
[webView loadRequest:[NSURLRequest requestWithURL:pdfUrl]];
}
@end
where shall I have this code? in the app delegate?
Code:
// Create an instance of PDFViewController
PDFViewController *controller = [[PDFViewController alloc] initWithNibName:@"PDFView" 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
controller.pdfUrl = [NSURL fileURLWithPath:finalPath];
// Push 'controller'
[self.navigationController pushViewController:controller animated:YES];
// Release 'controller'
[controller release];