I put this into a file:
#if DEBUG
#warning("Building with debug")
#endif
It always warns when I build in Xcode -- even when I'm (allegedly) using the Release configuration.
I created a new scheme called "Release", and changed the Run > Build Configuration to "Release". (And then I went and changed everything from "Debug" to "Release" in the scheme.)
But I always get the warning. (In Xcode. If I use xcodebuild -configuration Release
I don't get the warning.)