After updating to XCode 6.3, compiler started giving this warning.
Comparison of address of 'myObject' not equal to null pointer is always true.
Here is my piece of code,
Scratching my head with it, but didn't find any solution or workaround to get rid of this warning.
My question is linked with question over here. But, it can't be solved using answer discussed.
Any help will be welcomed :)
Correct way of checking the pointer is
if (anotherInView != nil) {
}
You are comparing address of a variable with the NULL
. Every variable has an address you can't have a variable whose address is NULL
, you can have a variable whose value is NULL
Also anotherRect != NULL
is again not valid. anotherRect
will always have a value as it's a struct
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With