为此,我使用了setNeedsDisplayInRect:,但有时视图会更新它的整个内容,从而导致卡顿。这在第三代iPads上尤其明显,但在模拟器和iPad2中也会发生较小程度的变化。touches withEvent:(UIEvent *)event // Asks that the view refreshes a smal rectangle
[self.view setNeedsDisplayInRect
我真正希望的是使用setNeedsDisplayInRect的正确方法,让核心框架对在下一个绘制周期中绘制的所有内容进行自动裁剪,以便它只自动绘制背景的那一部分,加上顶部的移动对象。= yv) // if the stone's coordinates have changed from its previous coordinates MyD.setNeedsDisplayInRect所以我把它放在括号里:
[MyD.setNeedsDisplayInRect(CGRectMake(x, y,