Is there a #pragma
to override a compile time warning, e.g.:
warning: 'ADBannerContentSizeIdentifier480x32' is deprecated (declared at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/System/Library/Frameworks/iAd.framework/Headers/ADBannerView.h:111)
I have to keep compatibility for pre-4.2 iOS devices by:
NSString *iAdSize = (osVersion >= 4.2) ? ADBannerContentSizeIdentifierPortrait : ADBannerContentSizeIdentifier480x32;
Thanks
Yes there is
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wno-deprecated-declarations"
//deprecated function
#pragma clang diagnostic pop
If you ever wonder what the proper syntax is for a certain error just find it in Xcode then look at the quick help
There's a build setting to toggle warning for deprecated functions.
Though the right way to do this would be check for OS version at runtime, and execute the deprecated method if necessary, or the new one otherwise.
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