Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

+[CATransaction synchronize] called within transaction

If I close my iPad app while I'm loading data from services, the app closes but then immediately opens again without my doing anything. At this point, I am not able to do anything; I can't close the app and I can't interact with the app or the device. The only way to use the device again is to restart it. The app does not crash, it simply disables the device.

When this happens, the following line appears in the console three times right after applicationWillResignActive and applicationDidEnterBackground:

+[CATransaction synchronize] called within transaction

It'd be almost okay if the app crashes, but the fact that the device is rendered completely useless is a huge problem. If I could intercept this bug or somehow detect when CATransaction raises this issue, then that'd be fine.

Any ideas?

like image 879
Confused Avatar asked Aug 25 '11 19:08

Confused


1 Answers

This happens when more than one animations are taking place on main thread. I faced the same problem. In my case application freezes while animating the CALayer and rotating the device simultaneously. So I stopped the animation while rotating the device.

Look for the code

[CATransaction begin]

//foo
[CATransaction commit]

Make sure that animation inside this code does not overlap with your other animations on main thread.

like image 182
Harsh Avatar answered Oct 23 '22 07:10

Harsh