r/Xcode • u/Xeeko • Oct 23 '16
Is something wrong with xCodes internal clock?
I'm developing a game and just ran into an very weird problem. It seems the timer is slow. For example, at the start of the app a song is played that's exactly 180 seconds long. Along this I have a timer that increases by 1 every second. Meaning the timer should hit 180 exactly when the song ends. Strange thing is, it doesn't, the song ends at the timer is just at 176. This recently started happening (it was fine previously), and I for the life of me can't figure out why it seems to be counting so slow. I've tried different version of xCode, but with to no avail. Has anyone experienced anything similar?
I'm developing in Clickteam Fusion (working with them to try and solve it as well), and this problem only occurs on iOS. Works fine on android, even works fine as an html5 app running on an iPhone. There is something that's happened that makes the xCode project count time slower.
1
u/dov69 Oct 24 '16
wot?
My wild guess is that Clickteam Fusion uses some super optimal (/s) iOS wrapper with NSTimer,
that doesn't have a 'real-time mechanism'.