Your Program 3: Throw up a textfield and a button, so that when the button is clicked, the following stuff happens. The directory is taken from the textfield. You generate an array of strings for those files ending in .pdf . You know how many PDFs are your folder. Just count them! So, now that you know how many buttons you need, use "math" to compute the size of your scrollview. Don't make it too big or too small. Make it just right. Now, it's pretty easy to place the buttons on the screen, just do that in a loop, AND if you put the name of the file as the button text, this will help you later. Now, what about the actions to the button? Actually, you only need to need write one action and attach that same action to all the PDF buttons. This action will open up the appropriate PDF in the UIDocumentInteractionController. So, how does the action know which file to open? It has to know which button was clicked. Fortunately, the action DOES know which button was clicked! Use the sender parameter. If you have stored the filename as the button title, you can then extract that title from the button that was clicked and now you know what file to open. Now, if you DON'T WANT to put the filename in the button (maybe it doesn't look right to you). What you can do is put information into the "tag" field. Just give the first button (when you make it) a tag of 0. The next button a tag of 1, and so forth. When the button is clicked, get the tag of that button, and then extract the filename from an array. (You would also need an array of just the PDF's.)