0

I have a method such as this:

-(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];

}

Do I need to release either the UITouch or the CGPoint to prevent any leaks?

Thanks!

James Dunay
  • 2,714
  • 8
  • 41
  • 66
  • The [memory management rules](http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmRules.html#//apple_ref/doc/uid/20000994-SW1) are simple and all-inclusive. – outis Dec 17 '11 at 22:13

1 Answers1

2

No. You never alloc/init or copy the touch so it is considered autoreleased.

CGPoint isn't an object or a reference so should never be released or autoreleased.

amattn
  • 10,045
  • 1
  • 36
  • 33