I have accidentally written a code after the return statement which can't be  reach by any code path. I was surprised to get no warning from Xcode for last line.
How do I get Xcode to show this?
-(int) hits{
    static int hits = 0;
    hits++;
    NSLog(@"Good Code");
    return hits ;
    NSLog(@"Bad code");
}
You should now see a list of potential issues that the compiler will check for. You can turn warnings for all of these issues on or off and even make the compiler treat the issue as an error.
Edit:
To expand on the comments:
You should now see the particular warning you were inquiring about upon building.
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