简体   繁体   English

在iOS 7设备上使用iOS 6.1 SDK构建应用会删除动画

[英]Building app with iOS 6.1 SDK onto iOS 7 device removes animations

I have updated all my test devices to iOS 7 and have a few apps which still need to be built for the old iOS 6.1 SDK. 我已将所有测试设备更新为iOS 7,并且仍然需要为旧的iOS 6.1 SDK构建一些应用程序。 I can build and run the apps fine, however all animations within the app no longer happen. 我可以很好地构建和运行应用程序,但是该应用程序内的所有动画都不再发生。 Instead, when I push a view controller it will just instantly appear instead of animating in. Also, any custom animations do not work and also just snap into place. 相反,当我按下视图控制器时,它将立即显示而不是进行动画处理。此外,任何自定义动画均不起作用,而且只能固定到位。

Has anyone else had this problem or has anyone fixed this before? 有没有其他人有这个问题或以前有任何人解决过吗?

Thanks in advance, 提前致谢,

Eish ish

*Edit: Just to clarify, if I build for the iOS 7 SDK animations work perfectly. *编辑:只是为了澄清一下,如果我为iOS 7开发的SDK动画效果完美。 If I build for any iOS 6.1 simulator then the animations also work perfectly. 如果我为任何iOS 6.1模拟器进行构建,那么动画也可以完美运行。 It only happens when I build onto an iOS 7 device using the iOS 6.1 SDK 仅当我使用iOS 6.1 SDK构建到iOS 7设备时才会发生

Ok so I have discovered the problem. 好的,所以我发现了问题。

It was quite an app specific problem but I thought I would outline the steps to debug here in order to help others that have perhaps come across the same issue. 这是一个特定于应用程序的问题,但我认为我将在此处概述调试步骤,以帮助可能遇到相同问题的其他人。

So eventually I ended up running the app and watching the console within xCode's Organiser. 因此,最终我最终运行了该应用程序,并在xCode的Organiser中观察了控制台。 You can find the console when you plug a device into your machine and the console can be found within the device in the "Devices" section of the organiser. 将设备插入计算机时,可以找到控制台,可以在管理器的“设备”部分的设备中找到控制台。

I cleared the console and tried to run an animation and got the following error in the console: 我清除了控制台并尝试运行动画,并在控制台中出现以下错误:

"CoreAnimation: warning, deleted thread with uncommitted CATransaction; set CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces." “ CoreAnimation:警告,已删除线程且未提交CATransaction;在环境中将CA_DEBUG_TRANSACTIONS = 1设置为记录回溯。”

Then in my build scheme, I added the above environment variable in order to print out the stack trace into the console. 然后在我的构建方案中,添加了以上环境变量,以便将堆栈跟踪信息打印到控制台中。 In doing so, I discovered that I was running an animation on a background thread and the thread was being destroyed before the animation had completed. 这样做时,我发现我正在后台线程上运行动画,并且在动画完成之前该线程已被销毁。

This meant that ALL animations within my app did not work beyond this point and fixing that issue resolved the problem for all animations within the app 这意味着我的应用程序中的所有动画均无法正常工作,并且解决了该问题后,该应用程序中的所有动画均得以解决

*edit: This problem never occurred in iOS 6 and only started happening after building for the iOS 6.1 SDK on an iOS 7 device *编辑:此问题从未在iOS 6中发生,仅在在iOS 7设备上构建iOS 6.1 SDK之后才开始发生

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM