IOS/iPad fstream pointer error
-
wrote on 2 Feb 2014, 09:47 last edited by
@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?
-
wrote on 2 Feb 2014, 19:47 last edited by
What is ss? What does ss.str() return?
-
wrote on 2 Feb 2014, 19:56 last edited by
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.
-
Hi,
This question is not directly related to Qt, you should rather ask it on an iOS developer forum.
-
wrote on 4 Feb 2014, 21:52 last edited by
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/5