Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [SOLVED] Accessing iOS Photo Folder
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Accessing iOS Photo Folder

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    carlinski
    wrote on 27 Aug 2014, 11:50 last edited by
    #1

    Using Qt5.3

    I know most of the folders for an App are sandboxed on iOS, however is it possible to get to the users photo folder? I want to give them the possibility of choosing a photo out of the camera roll.

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Gianluca
      wrote on 28 Aug 2014, 18:17 last edited by
      #2

      You cannot directly using the Qt API, you have to use a iOS native API:

      https://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html

      You can easily mix C++ and objective-C code in a Qt project simply adding a '.mm' source file.
      In .pro file:
      @
      OBJECTIVE_SOURCE += mysource.mm
      @

      and inside the .mm you can mix C++ with objective-C code like that:

      @

      void MyQtObjectClass::someMethod() {

      if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
      ... etc
      }

      }

      @

      1 Reply Last reply
      0
      • C Offline
        C Offline
        carlinski
        wrote on 28 Aug 2014, 19:27 last edited by
        #3

        OK, that gives me something to work with. Will take a good look.

        So would the code above give me direct access to the folder, so I can read the files?

        Does anybody have any good examples of this?

        Thanks.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          Gianluca
          wrote on 29 Aug 2014, 04:46 last edited by
          #4

          On iOS you never get a direct access of things outside your app.
          There is always an API that pass the control to iOS system and return to you with a result from the user.
          In the case of UIImagePickerController, when you launch it, it will appear to the user a new screen (under the iOS control) where the user navigate and choose the picture and after that your app get only the image user chosen.
          This is what I know.

          For examples, try to look in the iOS documentation and tutorial there are a lot of examples.

          https://developer.apple.com/Library/ios/documentation/AudioVideo/Conceptual/CameraAndPhotoLib_TopicsForIOS/Articles/PickinganItemfromthePhotoLibrary.html

          1 Reply Last reply
          0
          • C Offline
            C Offline
            carlinski
            wrote on 29 Aug 2014, 05:25 last edited by
            #5

            Thank you for that. That makes a lot more sense now.

            1 Reply Last reply
            0

            5/5

            29 Aug 2014, 05:25

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved