Search code examples
iospdfview

viewing PDFiles in an array


I'm new to xcode and iOS programming and I have been enjoy the learning adventure to say the list. I'm now stuck here.

Question: how do you make an array of files specifically pdf files? I would like to have a page where there is a list of names, say "1, 2, 3, 4, 5" referring to the pdf and a next window where the results of clicking on those names displayed.

I can simply create a bunch of pages with pdf display but I know that is not efficient. Thank you.


Solution

  • You can add pdf files to an array in the same manner as other objects.

    e.g. something like:

    NSArray *pdfs = [NSArray array];
    pdfs = [pdfs arrayByAddingObject: <your PDF> ];
    

    As far as displaying them, you could use a UITableView for your list and use a UIWebView to display the content.