+[CATransaction synchronize] called within transaction

前端 未结 2 865
眼角桃花
眼角桃花 2021-01-01 09:09

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 a

2条回答
  •  生来不讨喜
    2021-01-01 09:53

    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.

提交回复
热议问题