我需要释放UITouch对象吗?

时间:2011-12-17 21:21:27

标签: objective-c ios xcode memory-management

我有一个这样的方法:

-(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以防止任何泄漏?

谢谢!

1 个答案:

答案 0 :(得分:2)

没有。您永远不会alloc/initcopy触摸,因此它被视为自动释放。

CGPoint不是对象或引用,因此永远不应该被释放或自动释放。

相关问题