Browse files/directories and select one

Discussion in 'iOS Programming' started by ischolar, Oct 17, 2010.

  1. ischolar macrumors newbie

    Joined:
    Oct 17, 2010
    #1
    Hello!

    Would like to know if there is a way to build an interface where the end user should be able to browse the files/directories of iphone device and select a file.

    Something similar to hit "browse" button and browsing for file then selecting a file as attachment in a mail client and hit "attach".

    Any references to study more on this and if anyone has come across such requirements to build in the interface???

    Thanks
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    You only have access to your own sandboxed area of the filesystem: you cannot open or view files from outside that area.
     
  3. ischolar thread starter macrumors newbie

    Joined:
    Oct 17, 2010
    #3
    Yeah I get your point.

    The file needs to be selected resides within the sandboxed area of the filesystem so that it is accessible by the app.

    Any ideas?
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    From that point you are on your own: Apple do not provide any browser/file selector. I'd suggest using NSFileManger to list the directory contents and a UITableView to display/drill down as required.
     
  5. ischolar thread starter macrumors newbie

    Joined:
    Oct 17, 2010
    #5
    Thanks robbieduncan.

    Let me try that with UITableView.


    Thank U!
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    Apple doesn't want UIs that resemble desktop file pickers. You should look at other apps and UIs that display "documents" and allow the user to choose from among them. This includes the photos app, ebooks, even iTunes on the desktop. The point is that many of these apps don't show a tableview or scrolling list of files. They don't show file extensions. The iPad apps tend to show a grid of icons that represent the documents. The grid does scroll because you can't fit all the documents on the screen at once. Typically they're not hierarchical, although some are. They just show a flat "list" of the "documents" with each document represented by an icon. Consider also Cover flow as a way of scrolling through a list of documents. Some apps like Air Sharing and the like do show a hierarchical tableview of files, but these apps are very file oriented rather than being more document oriented.

    Anyway there are a lot of options.
     

Share This Page