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] Writing local file on iOS device
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Writing local file on iOS device

Scheduled Pinned Locked Moved Mobile and Embedded
ios files sandb
4 Posts 3 Posters 1.6k Views 2 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.
  • D Offline
    D Offline
    DRoscoe
    wrote on last edited by DRoscoe
    #1

    I am trying to write a local file from my iOS app created with Qt 5.4. After initial research it seems I need to write the file to the local Documents folder within my app bundle, but all of my attempts thus far have failed. I dumped the current path from a QDir object. It seems to stop at the app:

    "/private/var/mobile/Containers/Bundle/Application/72CF36AB-D88B-4877-8BCF-F73D49284CEE/tap_new_display_app.app"

    What is the best way to do this within Qt framework?

    Thanks!

    1 Reply Last reply
    0
    • patrikdP Offline
      patrikdP Offline
      patrikd
      wrote on last edited by patrikd
      #2

      hi,
      what worked for me :
      new QFile(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) + "/" + name);
      best,
      patrik

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        QStandardPaths with QStandardPaths::DocumentsLocation looks like what you want.

        Just beware of the automatic backup of the documents, depending on why you will be using it, disabling the backup might be a good idea

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • D Offline
          D Offline
          DRoscoe
          wrote on last edited by
          #4

          Thank you, that worked perfectly!

          1 Reply Last reply
          0

          • Login

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