Let's see an example:
NSLog(@"Hello, World!");
int i = 1;
switch (i) {
case1:
NSLog(@"OK");
break;
}
If I placed this code in a project with the default settings created by Xcode, the result wouldn't output the "OK" string, due to the "case1:" typo which transformed the "case 1:" case statement into an unused label. The compilation wouldn't produce any warning. Neither would the static analyzer.
You can however catch such problems at compile time, by changing the default settings like so:
Another useful setting to have is this:
which runs the static analyzer on every compilation. I found this combination of settings very useful to smoke out bugs shortly after they have been introduced.