+ [CATransaction synchronization] called in a transaction

If I close the application for the iPad while I download data from the services, the application closes and then immediately opens again without doing anything. I can’t do anything at the moment; I cannot close the application, and I cannot interact with the application or device. The only way to use the device again is to restart it. The application does not crash, it just turns off the device.

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

+[CATransaction synchronize] called within transaction

It would be almost normal if the application crashes, but the fact that the device is completely useless is a huge problem. If I could catch this error or somehow detect when CATransaction is causing this problem, then everything will be all right.

Any ideas?

+25
source share
1 answer

This happens when several animations occur in the main topic. I faced the same problem. In my case, the application freezes during CALayer animation and device rotation at the same time. So I stopped the animation while rotating the device.

Look for the code

[CATransaction begin]

//foo
[CATransaction commit]

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

+9

Source: https://habr.com/ru/post/1547163/


All Articles