我知道Core Animation在单独的线程中调度它的动画,正如文档中所述。不过,我的动画似乎阻止了我的主线。所有动画开始和芬兰语。 (有或没有kCATransactionDisableActions设置为true),但变得跳跃,主runloop摊位。如何防止Core Animation阻止我的主线程?
我在做什么错?
概念例如:
[NSTimer scheduledTimerWithTimeInterval:0.0333 target:self selector:@selector(gameEngine) userInfo:nil repeats:YES];
- (void)gameEngine
{
[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
myLayer.position = CGPointMake(newX, newY);
[CATransaction commit];
}
备案:我们正在潜入OpenGL ES。 – Kriem 2009-03-02 21:29:41