OGeek|极客世界-中国程序员成长平台

标题: ios - 当 UIView dealloc 仍然留下引用时删除所有当前动画 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 07:12
标题: ios - 当 UIView dealloc 仍然留下引用时删除所有当前动画

我有一个 UIView 子类,它在 iOS 项目中经常被分配和释放。我添加了 [self.layer removeAllAnimations]; 以尝试在销毁对象之前删除所有动画。偶尔,我仍然会收到 -[ClassName animationDidStop:finished:]: message sent to deallocated instance。现在,不应该删除动画会杀死该委托(delegate)并阻止它尝试调用 animationDidStop 吗?



Best Answer-推荐答案


请看"Will sending -removeAllAnimations to a layer also propagate to all it's sublayers?"这可能是您问题的可能答案。

关于ios - 当 UIView dealloc 仍然留下引用时删除所有当前动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5598768/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4