forum

home / developersection / forums / is condition is necessary before releasing instance

Is condition is necessary before releasing instance

Anonymous User 1554 03-Nov-2015

Whenever I release any instance that could exists or not, I am using this code:

if(myObject!=nil)
{
   [myObject release];
}

but I have a confusion, sending a message to nil is not a problem;
I want to know, is that condition necessary?


Updated on 04-Nov-2015

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By