objective c - difference between nil and released object -


i'm new objective-c , and can't understand this. know can send message nil (it's hyped feature of objective-c), can't send message released object, getting exception in case, difference between them?

nil memory address 0. runtime knows not when address messaged, because the predefined nonexistant object address.

however, deallocated object random memory address, because pointer isn't cleaned when formerly valid object destroyed. since not prescribed nonexistant object address, runtime doesn't know it's invalid, , try send message. crash program right away.

you can avoid setting variables nil once you've released them.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -