I inherited an iOS project that targets iOS6+. A few weeks ago I moved it to Xcode 6 and cleaned up all of the warnings. One such warning was:
'UITextAttributeTextShadowColor' is deprecated: first deprecated in iOS 7.0 - Use NSShadowAttributeName with an NSShadow instance as the value
My fix to this used NSShadowAttributeName, but I did it improperly and it caused the app to crash at a certain point during execution. When I discovered this weeks later, I reverted to the old code temporarily. However, when I reverted to the old code, the deprecation warnings did not come back. I have been unable to figure out why and would like to remedy this - it alarms me that warnings aren't being shown.
For what it is worth, in certain sections of code I needed to silence deprecation warnings as a result of needing to maintain support for iOS 6. In those instances, there is separate code for iOS 6 and iOS 7+ devices and the iOS 6 code is surrounded with:
SILENCE_IOS7_DEPRECATION(
// iOS 6 code here
);
(see https://stackoverflow.com/a/26564750/3352624) This uses:
#define SILENCE_DEPRECATION(expr) \
do { \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
expr; \
_Pragma("clang diagnostic pop") \
} while(0)
#define SILENCE_IOS7_DEPRECATION(expr) SILENCE_DEPRECATION(expr)
#define SILENCE_IOS8_DEPRECATION(expr) SILENCE_DEPRECATION(expr)
I opted against adjusting Xcode settings and turning off warnings for large amounts of code.
So I'm confused why the deprecation warnings no longer show when I revert the code back to what it was before.
Here's what I've tried:
- Removed all references to the SILENCE_DEPRECATION macro from my code
- Verified
Deprecated Functions
is on underBuild Settings
for the target - Verified my
Base SDK
is set toLatest iOS (8.1)
and myiOS Deployment Target
is set toiOS 6.0
- Added the
-Weverything
toOther Warnings Flags
underBuild Settings
for the Target - Checked out an old version of my workspace from git which was before any of my changes
- Quit and restarted Xcode 6
- Tried Xcode 5
- Restarted my computer, then started Xcode
None of these things caused the deprecation warnings to come back. Any ideas what should I try next?