I want to check if my object address is 0x0. How to do this in objective c?
Just compare the link as
if (obj == nil)
or
if (obj == NULL)
if (obj == 0)
if (!obj)
You can use any of them, they are all the same.
if(object == nil){ // it means memory for this object is not allocated }
You can check the null pointer as follows:
if (!myObject) { // myObject is nil (0x0). }
Or like this:
if (myObject == nil) { // myObject is nil (0x0). }
this address is zero, so you need to compare it with nil
nil