I have an int value defined in one of my method:
int value = [self someMethodThatGetsAnINT];
Later on I have some "ifs" that check upon this value.
How to I express: if (value == nil)?
When I try do this intuitive code writing I get a warning saying:
Semantic Issue: Comparison between pointer and integer ('int' and 'void *')
nil
is just a 0
:) Try this :
if (0 == value)
However, why would you be testing nil
against an int - something sounds funny here :)
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