2011-12-17 95 views
0

我有一个方法,像这样:我是否需要释放UITouch对象?

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

谢谢!

+0

[内存管理规则](http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-SW1)简单而全面。 – outis 2011-12-17 22:13:36

回答

2

号你永远不alloc/initcopy触摸因此它被认为自动释放。

CGPoint不是一个对象或参考所以不应该被释放或自动释放。

相关问题