Do I need to retain an object if I'm only using it inside the scope of a single method?

Posted by morgancodes on Stack Overflow See other posts from Stack Overflow or by morgancodes
Published on 2010-03-23T02:07:41Z Indexed on 2010/03/23 2:11 UTC
Read the original article Hit count: 316

Filed under:

I'm getting weird EXC_BAD_ACCESS errors. I thought that I didn't need to retain objects if I was didn't need them after the method exited, but I want to double-check that. In the following, do I need to retain "tData"?

-(void)myMethod:(UITouch*)touch{ TouchData *tData = (TouchData *)CFDictionaryGetValue(datasByUITouch, touch); [tData doSomething]; }

© Stack Overflow or respective owner

Related posts about objective-c