Do i need to release UITouch objects?

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!

Answers


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.


Need Your Help

Enormous Sql Generated for Linq-to-Sql Grouping

sql sql-server asp.net-mvc linq linq-to-sql

i have one linq to sql query that simply joins three tables and then performs grouping. Here is the query

Creating a JSON object

java android json

I am making a JSON request to server using Java. Here is the following parameters.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.