Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
macOS Sierra + Qt 5.6.2 = ApplePersistenceIgnoreState issue?
I have recently upgraded to Qt 5.6.2 and I don't know whether it is directly to it, but on macOS, my application now shows a message like this one:
2016-10-13 16:14:32.843 OpenCOR[3340:929508] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to /var/folders/bp/8jz3rpfx5c91z2qgx7jfv9180000gn/T/ws.opencor.2016-10-13.savedState
I initially thought that it might have something to do with macOS Sierra, so I decided to try the previous version of my application (which was compiled using Qt 5.6.1) and everything is fine, i.e. I am not geting that
If I then go back to my Qt 5.6.2 based application, the message is back...
Any ideas anyone?
P.S.: FWIW, I have googled for a solution and came across this, but even if their 'fix' could be applied to my situation, this is clearly not something that I am willing to ask my users to do...
Hmm, I have just realised that a possible culprit could be Xcode 8, to which I have also upgraded lately...
You can find here the use of ApplePersistenceIgnoreState.
And here how to shut off the message here.
I must be missing something because I cannot find anything using your first link.
As for your second link, it is the one I mentioned in my P.S., and it corresponds to what I don't want to have to do that to shut off that message. It's just not a neat solution. I mean that an end-user shouldn't have to enter that kind of a command at the terminal.
Oops, my bad regarding your first link. I had originally done a search for
ApplePersistenceIgnoreStateon that page, but it hadn't returned anything, but it does now. Not sure what happened!
Anyway, in the end, I think I might be able to apply the solution in the second link, this directly from my application. Will check that tomorrow...
It looks like
ApplePersistenceIgnoreStatemight (only?) be for debugging purposes. Hmm, I am pretty certain that I was running the debug version of my application when I got that message. I am therefore wondering whether I will still get it with the release version of my application... (Sorry, thinking aloud here... :))
Not a bad idea to share your thinking, it's a valid check.
Can you also test whether you have the same happening with 5.6.1 ?
There might be something that changed with Sierra or Qt 5.6.2.
With regards to Qt 5.6.1, I did try with the previous (release, not debug) version of my application (which was indeed built using Qt 5.6.1), and it didn't generate the aforementioned
All I think I know at this stage is that (on macOS Sierra):
- Release w/ Qt 5.6.1 = fine.
- Debug w/ Qt 5.6.2 = not fine.
I can definitely try Release w/ Qt 5.6.2, but it would be a bit tedious to try Debug w/ Qt 5.6.1 since I upgraded to Xcode 8 and Qt 5.6.1 is known not to work with Xcode 8 out of the box.
Hmm... not sure how and/or why, but (after having restarted my MBP) everything is now fine... In other words, I am not (for now at least) getting that
FWIW, I now simply have this at the beginning of my
main()method, thus 'fixing' my original problem:
#ifdef Q_OS_MAC QProcess::execute("defaults", QStringList() << "write" << "ws.opencor" << "ApplePersistenceIgnoreState" << "NO"); #endif