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. IOS/iPad fstream pointer error
Forum Update on Monday, May 27th 2025

IOS/iPad fstream pointer error

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 1.6k Views
  • 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 2 Feb 2014, 09:47 last edited by
    #1

    @std::fstream* ptr_fsZoomfile = new std::fstream(ss.str(), std::fstream::in | std::fstream::binary);@

    This line works great on Linux, Mac, Windows and Android. On iOS (iPad) it crashes. File is all OK because if I create it as a none pointer it works OK.

    I need to create it as a pointer because it is going into a vector.

    Any thoughts?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sandy.martel
      wrote on 2 Feb 2014, 19:47 last edited by
      #2

      What is ss? What does ss.str() return?

      1 Reply Last reply
      0
      • C Offline
        C Offline
        carlinski
        wrote on 2 Feb 2014, 19:56 last edited by
        #3

        ss is a stringstream I use to build the filename.

        str returns const string.

        I have also checked that by putting a const string in, i.e. the full typed path.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Feb 2014, 21:42 last edited by
          #4

          Hi,

          This question is not directly related to Qt, you should rather ask it on an iOS developer forum.

          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
          0
          • C Offline
            C Offline
            carlinski
            wrote on 4 Feb 2014, 21:52 last edited by
            #5

            Yes, should have posted on an iOS site really.

            Anyway, for anybody searching:

            I managed to sort this today, by using a QSharedPointer, which xcode is much happier with:

            @QSharedPointer<fstream> ptr_fsZoomfileMultiple = QSharedPointer<fstream> (new fstream(ss.str(), std::fstream::in | ios::binary));@

            1 Reply Last reply
            0

            1/5

            2 Feb 2014, 09:47

            • Login

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