开发者

Pause animation in EAGLView which is in a UITableViewCell

开发者 https://www.devze.com 2022-12-28 16:13 出处:网络
I have an animation in a EAGLView which is itself in a UITableViewCell. How can I pause the animation in the EAGLView when the view is not visible?

I have an animation in a EAGLView which is itself in a UITableViewCell. How can I pause the animation in the EAGLView when the view is not visible?

Normally, I would simply use the responsible UIViewController and listen to viewDidDisappear. But how do I do that if the EAGLView is in a table开发者_StackOverflow中文版?


I don't think that this is a task to implement at all. Once your cell is scrolled out of view, it will be deallocated instantly. So if you have a Custom Cell, the animation will have to be stopped in -dealloc anyhow.

EDIT 1: Actually, I was not really precise: I wrote "instantly", but of course, this depends on the OS and Apple and may be changed in future versions. Actually, the cell is deallocated whenever the OS garbage collector wants. Currently, Apple deallocates one cell whenever it needs a new one. Usually, scrolling a table implies that one row disappears and a new one appears, so that's why deallocation seems to happen instantly. If the view, that is switched on, contains a table view, than you will see the same instant deallocation.

0

精彩评论

暂无评论...
验证码 换一张
取 消