Do I need to release the temp Object from this example?

Posted by Tattat on Stack Overflow See other posts from Stack Overflow or by Tattat
Published on 2010-03-18T16:09:39Z Indexed on 2010/03/18 16:31 UTC
Read the original article Hit count: 319

-(IBAction) testTemp: (id) sender{
    id tempObj;
    tempObj = otherObject; //the otherObject will be released in dealloc method;
    [tempObj doSomething];
}

As you can see, I use the tempObj for temp use. I won't use it after the user quit this method, should I need to release the tempObj? and why?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about programming-languages