19
Apr

In .h file

IBOutlet UIWebView *webView;
NSURL *pdfUrl;

In .m file

NSString *path = [[NSBundle mainBundle] pathForResource:@”Sample” ofType:@”pdf”]; // Giving the path as the resource and the name of the pdf to load.
pdfUrl = [NSURL fileURLWithPath:path]; // creating a fileurl from path
[webView loadRequest:[NSURLRequest requestWithURL:pdfUrl]]; // Loading the url request using the url to a webview.

, , , , , ,


Posted by on 19 Apr 2011 by abhijithvg in Apple MAC, Box 2d, Cocoa, Cocos2d, iPad, iPhone, Mac OS X, Objective C, Tips and Tricks

Add reply

*