You can achieve this via two different cases as it depends on your requirements. Over here I have included both of the cases, & this will work with charm :
Case 1: Download the PDF, write it locally & set the path.
NSData *pdfData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:@"PDFurlString"]];
//Store the Data locally as PDF File
NSString *resourceDocPath = [[NSString alloc] initWithString:[[[[NSBundle mainBundle] resourcePath] stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"Documents"]];
NSString *filePath = [resourceDocPath stringByAppendingPathComponent:@"myPDF.pdf"];
[pdfData writeToFile:filePath atomically:YES];
//Now create Request for the file that was saved in your documents folder
NSURL *url = [NSURL fileURLWithPath:filePath];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView setUserInteractionEnabled:YES];
[webView setDelegate:self];
[webView loadRequest:requestObj];
Case 2: View the PDF directly in WebView using NSData.
[webview loadData:fileData MIMEType:@"application/pdf" textEncodingName:@"utf-8" baseURL:nil];
Now, at the end,if you are looking to open the PDF into some other App,
Step 1 :
Use the First Case, just grab the url.
Step 2 :
You can find the biggest database of those url schemes here. Now, how to use? All that we'll need is UIApplication. First, we need check if the iOS can open specific url.
[[UIApplication sharedApplication] canOpenURL:[NSURL urlWithString:@"fb://profile"]];
Step 3: If this method returns yes then the user has the facebook application installed. To open the following application you need to call:
[[UIApplication sharedApplication] openURL:[NSURL urlWithString:@"fb://profile"]];
Which will open your facebook profile on the facebook application.
Alas, there is no possibility of disabling any other application on the iOS, since each and every third party software is being sandboxed.
Hope this was helpful to you.