我可以将CADisplayLink用作NSTimer吗?(Can I use CADisplayLink as an NSTimer?)

编程入门 行业动态 更新时间:2024-10-19 13:19:38
我可以将CADisplayLink用作NSTimer吗?(Can I use CADisplayLink as an NSTimer?)

我想知道,即使我没有做任何动画,我可以使用CADisplayLink计时器而不是NSTimer吗?

我想调用某种方法就像使用NSTimer时一样,只是在更高的频率下(60 Hz会很好),所以我想知道CADisplayLink Timer是否可以工作,即使该方法只是进行了一些计算和不是任何动画......

PS我在iPhone 4上测试

I was wondering, can I use a CADisplayLink Timer instead of an NSTimer even though I'm not doing any animation?

I'd like to call a certain method much like when using an NSTimer, only just at a much higher frequency (60 Hz would be nice), so I was wondering if a CADisplayLink Timer would work even though the method simply does some calculations and not any animation...

P.S. I'm testing on an iPhone 4

最满意答案

我不明白为什么不。 您甚至可以从CADisplayLink获得更好的性能,因为它没有执行任何动画。 您可能遇到的唯一问题是Apple Review Board将如何使用它。

我建议在使用之前查看Class Reference以及提供的avTouch示例代码。

I don't see why not. You may even receive better performance from CADisplayLink because it is not performing any animation. The only problem you might run into is how the Apple Review Board will like your use of it.

I would suggest looking over the Class Reference along with the avTouch Sample Code provided before using it.

更多推荐

本文发布于:2023-07-31 01:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340508.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:CADisplayLink   NSTimer

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!