in Technology by

What happen if we send any message to an object which is released?

1 Answer

0 votes
by

Calling release on an object does not necessarily mean it’s going to be freed. It just decrements the object’s retain count. It’s not until the retain count reaches 0 the object gets freed (and even then, the object might be in an autorelease pool and still not be freed quite then).

So, you might release your object but you could still be pointing to it. And then it could get autoreleased. And then you send it a message — but maybe the object is garbage now.

Related questions

0 votes
0 votes
    What Happen If We Give 220 Volts Dc Supply To D Bulb R Tube Light?...
asked Dec 12, 2020 in Technology by JackTerrance
0 votes
    What will happen if we provide concrete implementation of method in interface? (a) The concrete class implementing ... of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    What will happen if we provide concrete implementation of method in interface? Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    What will happen if we provide concrete implementation of method in interface? (a) The concrete class ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What will happen if we call setTimeout() with a time of 0 ms? (a) Placed in stack (b) Placed ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Security misconfiguration cannot happen at any level of an application stack....
asked Mar 20, 2021 in Technology by JackTerrance
0 votes
    WHAT TYPE OF HORMONES ARE RELEASED BY THE BODY WHEN WE EXERCISE? * A. ENDORPHINS B. PHEROMONES C. BILE D. MORPHEMES Select the correct answer from above options...
asked Dec 11, 2021 in Education by JackTerrance
0 votes
    Write error message given by C compiler during compilation if we use %d to print float variable Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
0 votes
    I am retrieving messages from an Outlook account. I am trying to get inline files and attachments from ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 24, 2022 in Education by JackTerrance
0 votes
    While I try to answer any question in brainly app, the cursor is moving from right to left instead of moving ... Why does it happen? Select the correct answer from above options...
asked Nov 29, 2021 in Education by JackTerrance
0 votes
    Having two thread, one product data, another one process data. The data is not just an int or float but a complex object. In ... = buffer; //mutex.unlock(); if(!tmp.data) std::cout...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    What happens with the objects if the array is released?...
asked Nov 10, 2020 in Technology by JackTerrance
0 votes
    What would happen if the protective tin coating over an iron bucket is broken in some places ? Select the correct answer from above options...
asked Jan 5, 2022 in Education by JackTerrance
0 votes
    If 3/10 is the probability that an event will happen, what is the probability that it will not happen Select the correct answer from above options...
asked Nov 15, 2021 in Education by JackTerrance
...