Q:

Supressing specific deprecated messages

I have this code that is supposed to run on iOS 6 and up. Apple deprecated some stuff on iOS 7 and at some point I have to have code like this:
if (isIOS7) 
   doItTheNewWay
else
   doItTheOldWay

the problem is that doItTheOldWay is deprecated on iOS7 and I see an error telling me that it was deprecated on iOS 7.
How do I get rid of this error in particular?
The line in the example is this:
    titleSize = [self.title sizeWithFont:font constrainedToSize:constrainedSize];

A:

You can use this, it works for me:
if (isIOS7)
    //doItTheNewWay
else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
    //doItTheOldWay
#pragma clang diagnostic pop

Credit goes there.

