我有这样的方法:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
//Use to animate drag
UITouch *touch = [touches anyObject];
CGPoint currentLocation = [touch locationInView:self];
[self colorDragedOver:currentLocation];
[touch release];
}
我是否需要释放 UITouch 或 CGPoint 以防止任何泄漏?
谢谢!
最佳答案
没有。您从不alloc/init
或copy
触摸,因此它被认为是自动释放的。
CGPoint
不是对象或引用,因此永远不应释放或自动释放。
关于objective-c - 我需要释放 UITouch 对象吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8548006/