I understand what the warning says. This is exactly how scoping rules work. I appreciate that some people want a nanny. I don't. How can I disable this warning?
You can't disable this warning in the current version of XCode. There is no build setting for it, nor does it have a warning ID which you could use to pass a flag to the compiler to tell it to quit whining.
For future reference, you can find that warning ID by going to the Log Navigator, clicking on the most recent build where the warning appeared, drilling down into the log to find the point where the 'compile' task shows up with an exclamation mark and click the 'more detail' button, which looks like a gray callout with 5 horizontal lines. You'll see the warnings/errors listed in detail, and if there was a warning ID it would appear on the line detailing the warning in yellow. At least, thats what I've been told by one of the Compiler Engineers at Apple. I have yet to see a warning that I actually want to disable have an ID appear in the log.
File a bugreport with Apple, tell them you want more options to disable warnings in XCode and list this one specifically.
In Xcode 4.4 this can be disabled by going to the build setting "Other Warning Flags" and setting the value "-Wno-shadow-ivar"
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