Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8977371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:21:19+00:00 2026-06-15T19:21:19+00:00

In iOS 6 the QLPreviewController no longer loads a PDF from a URL. It

  • 0

In iOS 6 the QLPreviewController no longer loads a PDF from a URL. It works fine in iOS 5. I have implemented the QLPreviewControllerDataSource methods as documented here.

#pragma mark - QLPreviewControllerDataSource
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller {
    return 1;
}

- (id <QLPreviewItem>) previewController: (QLPreviewController *) controller previewItemAtIndex: (NSInteger) index;
{
    NSURL *fileURL = [NSURL URLWithString:@"http://www.bliley.net/XTAL/PDF_Instructions/Test_File.pdf"];
    return fileURL;
}

This works perfectly in iOS 5, however in iOS 6 the console outputs:

Couldn't issue file extension for path: /XTAL/PDF_Instructions/Test_File.pdf
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:21:20+00:00Added an answer on June 15, 2026 at 7:21 pm

    I downloaded the file from remote url and saved locally, then I display the PDF using the QLPreviewController .In iOS 6 its working.

    First i saved the file from remote url using the following code :

        NSString *local_location;
    
        NSString *path = [[NSBundle mainBundle] pathForResource:@"sampleData" ofType:@"plist"];
            path = NSTemporaryDirectory();
        local_location= [path stringByAppendingPathComponent:[NSString stringWithFormat:@"My_Invoice.pdf"]];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString: remoteurl]];
            [request setDownloadDestinationPath:local_location];
            [request startSynchronous];
    

    For showing the Pdf :

    QLPreviewController* preview = [[QLPreviewController alloc] init];
            preview.dataSource = self;
            [self presentModalViewController:preview animated:YES];
    

    QLPreviewController delegate methods are :

    - (NSInteger) numberOfPreviewItemsInPreviewController: (QLPreviewController *) controller
    {
        return 1;
    }
    
    - (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
    {
    
        return [NSURL fileURLWithPath:local_location];
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Beginner iOS dev here. I have a problem in my array. Im making an
iOS beginner here. I have the following code: [facebook authorize:nil delegate:self]; NSString *string1=[facebook accessToken];
iOS newbie question here. I have a UITabBarController as my root controller with a
On iOS 6 this block of code works fine: - (NSString*)cLocalImageName { [self willAccessValueForKey:@cLocalImageName];
iOS beginner here. I'm using the following code to save my facebook accessToken and
In iOS I have an app where I need to wait for the currently
iOS 5.0 SDK I have a method that took a parameter as a 'type'
iOS 6, iPhone 5, Xcode 4.5 I have an app that let users download
My IOS application program have tableview in navigation controller secondview. I want to save
iOS lecture i downloaded from iTunesU lists 3 forms of communication from the View

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.