I have inherited an iOS project that targets iOS6 +. A few weeks ago I moved it to Xcode 6 and cleared all 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 for this used the name NSShadowAttributeName, but I did it wrong and it caused the application to crash at some point at runtime. When I found out these weeks later, I temporarily returned the old code. However, when I returned to the old code, the deprecation warnings did not return . I could not understand why and would like to fix it - he warns me that warnings are not displayed .
For what it costs, in some sections of the code I had to turn off obsolescence warnings due to the need to support iOS 6. In these cases, there is a separate code for iOS 6 and iOS 7+, and the iOS 6 code is surrounded by:
SILENCE_IOS7_DEPRECATION(
);
(see https://stackoverflow.com/a/3185185/ ):
#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 refused to configure Xcode settings and disable warnings for a lot of code.
So, I am confused why deprecation warnings no longer appear when I return the code back to what it was before.
Here is what I tried:
- Removed all references to the SILENCE_DEPRECATION macro from my code.
- Confirmed
Deprecated Functionsenabled under Build Settingsfor target - It’s confirmed that mine is
Base SDKset to Latest iOS (8.1), and mine is iOS Deployment Targetset toiOS 6.0 -Weverything Other Warnings Flags Build Settings Target- git, .
- Xcode 6
- Tried Xcode 5
- , Xcode
. , ?